-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
--watch doesn't work in latest (1.4.15) webpack on osx yosemite 10.10 #675
Comments
You can try the NewWatchingPlugin: // webpack.config.js
var webpack = require("webpack");
module.exports = {
plugins: [
new webpack.NewWatchingPlugin()
]
}; |
Nope, doesn't work either( |
You can run the tests here: https://github.com/webpack/watchpack |
hm, all tests passed |
So in general the watching works fine... (NewWatchingPlugin) |
Well, still no idea why this happened, after several restarts and reinstalls of node and npm everything went back to normal. Maybe some hardware issue? |
I'm experiencing the same issue on OS X 10.9.5 with webpack 1.5.x. Edit: Maybe it's not the same issue but related? |
I second that, webpack 1.5.x doesn't watch files properly on Mac OS X (triggers only on second or third change) while webpack 1.4.x works fine. |
@amccloud @andreypopp should I reopen this one? |
FYI, this is a bug in OS X. Try the suggestions listed in this article to fix the problem: Here is a copy of the meat of the article in case that link ever goes away:
|
The previous checklist did seem to help after a few attempts. |
1.4 is not the latest.
Ingwie@Ingwies-Macbook-Pro.local ~/W/BIRD3 $ webpack --version
webpack 1.8.9
I am on 10.10 myself and it works. o.o
|
I'm using webpack 1.9.7 and I also noticed this problem. As noted above, this is likely due to a bug in OS X, and therefore won't be fixed anytime soon.. |
Occurs on 1.9.11 and OS X 10.10.3. Re-cloning the affected directory from git fixes things for a few minutes, then the problem recurs (permanently until another reclone.) No other workaround had effect, e.g., renaming the directory, rebooting. mocha --watch, DropBox, and Google Drive are all watching this directory for changes and catching them successfully. Perhaps the mechanism webpack is relying on is broken in OS X, but other tools seem to have worked around it or just not used that particular mechanism? |
I have the same problem. I figured out a temporary solution. It works for a while after the move. |
Seeing a lot of interesting anecdotes here, but unfortunately not much that gives me a clue what's going wrong. In some cases it does look like it might be related to switching versions of node or io.js. As such, The other potential solution I'd recommend for anyone suspecting something odd/wrong with their local system is switching watch modes - try using the polling mode (which is the equivalent of what mocha's watch uses). |
@es128 Occurs for me with Atom 0.210.0, SublimeText 3083, and vim 7.3 (Apple's build). Adding --watch-polling doesn't improve the situation, i.e., neither works once a dir has gone bad: % node_modules/webpack/bin/webpack.js --watch
% node_modules/webpack/bin/webpack.js --watch --watch-polling I typically use Z shell 5.0.6, but also tried running the watch in Bash 3.2.57. This project is using iojs 2.1.0. If you think that is a possible culprit, I could certainly check if using good old node has an effect. |
I am using sublime 3083. It stopped working after webpack watch and text editor were left running for a few days last time. But I just got back from a weekend trip and it is fine right now. |
@ylg Sounds very strange. If you're willing to spend some time debugging, I'd be interested in the result if you were to use the example script in chokidar's repo, logging out the I wonder if there is something about Dropbox and/or Google Drive contributing to these issues, although that isn't something I've seen reported before. |
I tried shutting down Dropbox and Google Drive and then making some changes; they were not caught by watch. Of course, it may be that one of those two had already permanently changed the directory, and so I'll try a new clone the next time I'm at a point without a bunch of outstanding code changes. I tried Miller's example script for chokidar (as shown in the README at https://github.com/paulmillr/chokidar) and it reported "change [filename]" each time I saved a file. PS If we can confirm @ying22's observation that taking weekend trips may resolve the issue, I'd prefer no fix be applied to the codebase—assuming the trips can also be taken during the week. |
I don't have dropbox or google drive |
Lol good call @ylg. So if chokidar by itself is correctly reporting change events under the same circumstances where webpack has trouble, then perhaps there is an issue somewhere upstream of the watch layer. Sounds like it's going to be tough to diagnose and debug though given the inconsistencies you've described. |
Btw this is the example script I was referring to for diagnostic purposes (with the |
Here's an example of the output from that file running via the same version of iojs after changing a file that a normal webpack run will bundle up, but watching missed, i.e., I had a --watch running at the same time as example.js:
One thing of interest, though probably not importance, is that the path capitalization is not the same as reported by Z shell, e.g., chokidar reports /My/path/file.js while Z prints /My/Path/file.js, i.e., only some capitalization is kept. |
@ylg the capitalization issue may be important. Do you have the option to rename those dirs to be lowercase only and see if that has any impact on the issue? Did you specify At least, it seems we have determined at this point that chokidar is NOT missing |
My top level dir was also capitalized before: "/Users/me/Work". Since the move, I have named it lowercase by accident: "/Users/me/work". And I haven't had any problems since. But this all started with OS X 10.10.3. |
Sounds like there may be some sort of issue with inconsistent capitalization in paths, but would need someone to come up with a clear reproducible case to be able to do anything about it. |
@StephanBijzitter thanks for the info, sorry, some old comments above lead me to the wrong path. I can confirm that the uppercare to lowecase trick worked in my environment: renaming the parent directory of the project from "/Users/keul/Projects" to "/Users/keul/projects" did the trick. |
The problem for me was that I needed to update npm. I had an old version and as soon as I updated, it started working. |
Ran into a similar issue, found this and wanted to share my solution. File changes were being detected, it just appeared that they were not. I ran watch with progress and saw that every save / touch something was happening, just no output. The issue turned out to be an incorrectly configured context. The initial start of webpack would create files, but watch failed to output changed files 95% of the time. Sometimes it would output one time and then never again. Very frustrating to diagnose.
My solution was to remove the context, and put 'modules' in front of the path in each entry. Have not had an issue since. In short, try the --progress flag if you think your watch is not picking up file system changes. It could just be the rebuild process is failing silently, and you need to check your config. |
I was having similar issues and they were solved by updating npm. |
@pfarnach what does "update npm" mean? From which version did you upgrade from and to what version? Edit after I learned npm can be upgraded independently of node. |
@stelund I should be more specific, I updated node from 0.12.2 to 5.7.1 using NVM (Node Version Manager), which subsequently updated my NPM from 2.7.5 to 3.6.0. (Side note: I highly recommend using NVM) |
Webpack uses the new NewWatchingPlugin() by default in the latest version. I had to force the old watch plugin:
This resolved the issue for me. |
Switching to the 'OldWatchingPlugin' worked for me as well... I'm running OSX 10.10.5 (Yosemite) |
Windows 10 x64 here, also had to |
Windows 10 x64 here, nothing above works for me so far. |
Tried @jordizle suggestion and didn't work for me on ubuntu 14.04 LTS. This happened after a recent upgrade as it was working before. Might try downgrading some parts and see where this came from. |
happening for me too on vagrant Ubuntu 14.04.4. found solution here: http://andrewhfarmer.com/webpack-watch-in-vagrant-docker/ |
Seems in Webpack2 the Heres my config - https://gist.github.com/amcdnl/1fefceb40d57414943e20c1b3976bb18 |
same problem here |
Any status? |
I have the same issue. (mac os - el capitan 10.11.6). |
same issue here. --watch-poll saves my day. |
I'm having the same issue on ubuntu 16.04 with 1.13.3 |
Closing this issue. If you still find a bug with watching, file it in the watchpack repo. Note that there are known issues when your parent directory contains special characters such as brackets or parentheses. See webpack/watchpack#42 for that. |
in Ubuntu 16.04 |
I have a single js file
entry.js
withdocument.write("foo")
line and runwebpack --watch entry.js bundle.js
. Webpack starts in watch mode, then I make some changes to a file and can't see the update to the bundle.The text was updated successfully, but these errors were encountered: