-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watchify not rebuilding #216
Comments
Follow up: All of Watchify's tests passed
Problem still persists, however. |
Nothing jumps out at me from your code. Applying a transform like babel (you mean babelify?) globally is really expensive, but that doesn't affect a rebuilds ability to kick-off. Did you try |
Is your project in your Dropbox (or similar) folder? I was having the same issue until I realized that was the culprit and moved the project into my regular FS. |
@TylerLH Negative, the projects are not in a Dropbox or Google Drive folder. Oddly enough, my work computer has the same project and specs as listed above and Watchify runs beautifully. |
@zertosh Yep, it is actually Babelify. The global is there due to some folders being symlinked in to node_modules for convenient requiring :) |
@TylerK so the exact same project works in one machine but not another? O_O I wonder if it's the symlinks |
@TylerK If you want to avoid the global transform you can try my pathmodify plugin (although I haven't tried it will var pathmod = require('pathmodify');
args.entries = [/* paths outside of node_modules */];
watchify(browserify(args)
.plugin(pathmod(), {mods: [
pathmod.mod.dir('app', '/path/to/dir-outside-of-node_modules')
]})
.transform(babel)
) |
@TylerK thanks. If you have any questions or feedback please open an issue on its repo. |
I'm having the same issue with the latest version of watchify, and I've been doing some debugging. In my particular case, it seems that chokadir is not properly working with fse, and I believe it is related to this: |
Same issue here on Ubuntu linux. Please note that since I've downgraded to watchify 3.1.2, I have no more rebuild issue.
|
I have a similar issue? I don't believe the problems are the same. using
Each rebuild unless I restarted my gulp tasks would be the same as the original startup build. I examined the cache for my index.jsx file and deleted it explicitly
only then do the changes get rebuilt and added to my dist directory. |
Ran into similar issues on OSX 10.10.4 with the following versions: iojs: 2.0.1 Watchify triggers sporadically or not at all per gulp session. A workaround (opts.poll) is in this issue: fsevents/fsevents#63 |
Had the same issue. @tptee workaround did it for me (the poll opts) ;)
|
awesome that worked for me thanks. |
Didn't work for me. Not rebuilding on update. var gulp = require('gulp'),
browserify = require('browserify'),
watchify = require('watchify'),
source = require('vinyl-source-stream');
var opts = {
cache: {},
packageCache: {},
debug: true,
entries: './test.js'
};
var b = browserify(opts);
b = watchify(b, {poll: true});
b.on('update', bundle);
function bundle() {
return b.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('./'));
}
gulp.task('build', bundle); UPD Looks like it was working. But when watchify do rebundle, the gulp task is not triggered, so there is no output. I have added the following to see the output from watchify: b.on('log', function(data) {
console.log(data);
}); |
I'm running into this issue too, and I was able to get it to work by manually removing the cache on bundle.on('update', function(filename) {
delete bundle._options.cache[filename];
bundle.bundle()
// gulp stuff
.pipe(source('app.js'))
.pipe(gulp.dest('public/js'));
}); |
I have this issue and find it happens intermittently. Some times it works and sometimes it doesn't. It happens more often in Linux environments. Weird thing, using |
I was able to get an scenario where the issue always happen. Basically it goes like this in my case.
If you run the same using |
So the issue is inside the |
@royriojas Interesting. So the main difference between 2.6.x and 3.0.0 is chokidar. Can you open a new issue to discuss this? |
Sure thing! @zertosh |
so actually @zertosh the issue is not really in chokidar I manage to find the difference between 2.6.0 and 3.2.3 in this function function collect () {
b.pipeline.get('deps').push(through.obj(function(row, enc, next) {
var file = row.expose ? b._expose[row.id] : row.file;
cache[file] = {
source: row.source,
deps: xtend({}, row.deps)
};
watchFile(row.file); // this is missing in 3.2.3 Adding it works again in my case.
this.push(row);
next()
}));
} I'm currently working on a solution that persist the cache to disk, so this will speed up builds even in no watch mode. So in my use case the initial |
@royriojas That |
Thanks @zertosh, will do it and prepare an small repo where that can be reproduced. |
Using Linux here. Not sure if this is still the same issue, but I'm finding that even with polling turned on it'll still skip some rebuilds. This issue is much worse on my spinning disk machine than my ssd machine, although it still happens for both. Setting Vim's noswapfile option seems to fix this. Maybe there's some kind of race condition going on? Seems to be sensitive to latency. |
hi all. Not sure if I am having the same issue that is relevant to this ticket.
|
I've been getting this issue sporadically on linux for a while too. One thing I've noticed is that only certain files seem to be affected. Once a file "goes bad" it will fail to rebuild that file on a change, but other files will trigger a rebuild. |
Issue replicated, pull request sent for review. |
@substack thanks for the PR! It looks like I may be having an issue similar to yours as I have found some files what work. Look forward to this being fixed! |
I'm still getting the issue where a certain file "goes bad" and subsequent changes to that file fail to get recognized until I restart the process. Changes to other files will continue to work fine. Using watchify@3.3.1 and browserify@11.0.1 on Ubuntu. |
yea, I am using 3.3.1 as well and it seems that only a couple files don't trigger a build. Restarting/recreating process doesn't help. |
I'm locking this thread because it's gotten too noisy. If you're having rebuild problems please open a new issue with details about your setup and some way to reproduce. I'd really like to help but if I can't reproduce it, then I can't debug it. |
@zertosh As per your direction, here is a new issue with my specs:
And here is my gulp bundle logic:
Let me know if you need any additional info! Much appreciated any attention you can give this problem as it's fairly blocking. :)
The text was updated successfully, but these errors were encountered: