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

watchpack watch not triggering when symlinked node_module files are modified when using webpack 'symlinks: true' #61

Open
txinfo opened this Issue Jan 16, 2018 · 7 comments

Comments

Projects
None yet
7 participants
@txinfo
Copy link

txinfo commented Jan 16, 2018

In a regular webpack project, a symlinked module in node_modules is watched for changes correctly (as long as the module in question is referenced).

However, if using 'symlinks:true' in webpack to resolve symlinks to their full path (e.g. when using --preserve-symlinks behaviour in angular-cli), it does not seem to watch for changes anymore.

I have tracked this behaviour down to the 'followSymlinks' option of DirectoryWatcher in watchpack (https://github.com/webpack/watchpack/blob/master/lib/DirectoryWatcher.js). The followSymlinks option is always set to false which causes an issue with file watching when webpack is set to resolve symlinks. If it is manually set to true in this scenario, the watching works. Ideally this option would be configurable.

@jukibom

This comment has been minimized.

Copy link

jukibom commented Jan 19, 2018

Yep, I'm seeing this exact problem with an angular 5 app and a linked node library I'm working on. Manually setting the flag works correctly.

@jukibom

This comment has been minimized.

Copy link

jukibom commented Jul 11, 2018

anyone looking for a horrifying stopgap waiting for this to be fixed, add
"postinstall": "sed -i 's/followSymlinks: false/followSymlinks: true/g' node_modules/watchpack/lib/DirectoryWatcher.js"
to package.json. Probably don't commit it into your repo though ;P

@svilendobrev

This comment has been minimized.

Copy link

svilendobrev commented Aug 29, 2018

same finding here, with same fix, for the same problem in opposite setup... bunch of symlinked files (under webpack + resolve.symlink=false) are not noticed for being changed.. because the actual links do not change. the followSymlinks:true fixes that.

@liujingbreak

This comment has been minimized.

Copy link

liujingbreak commented Nov 2, 2018

Me, another Angular 7 developer facing same problem.
It has been 10 months...

@needo2

This comment has been minimized.

Copy link

needo2 commented Nov 22, 2018

Experiencing this with 'symlinks: false'

@LaKing

This comment has been minimized.

Copy link

LaKing commented Dec 9, 2018

Finally I found this. Fix from @jukibom works!

@floribon

This comment has been minimized.

Copy link

floribon commented Dec 12, 2018

I'm also having this problem when I symlink a folder in my node_modules and use symlinks: false.

@jukibom workaround works for now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment