You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
watchpack watch not triggering when symlinked node_module files are modified when using webpack 'symlinks: true' #61
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.
Reacted by Jay Faulkner, Bertie, Gergely Sárosi, KentuckyMC, Parsha Pourkhomami, immortal tofu, Dustin Deus, Björn Zeutzheim, Brayden C, Redas Jarušaitis and 15 more
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
Reacted by Artur Eshenbrener, L.J., Florian Ribon, El Pupi, Sunshine, Jeswin, Ferenc Einreinhof, Nathan Kelly, matteocng, Miloš Havlíček and 3 more
Reacted by Parsha Pourkhomami, Artur Eshenbrener, L.J., Ersin Akinci, Faris Masad, Jeremy Walker and Martin Pärtel
Reacted by István Király and Florian Ribon
Reacted by L.J., Florian Ribon, Darren Crossley, Ersin Akinci, wikt0r and Jeswin
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.
Reacted by Nathanael Anderson and Artur Eshenbrener
Even if this issue is closed by @sokra following the merge of a pull request that seems to fix the issue, the issue still exists. I.e. in webpack, there is still no way to pass the followSymlinks option.
@raf64flo, in my case @jukibom's fix still works. At time of writing I use webpack 4.41.0.
I built upon @jukibom's suggestion in order to perform the modification at runtime, via monkeypatching, and have a "less temporary" temporary code:
Activity
jukibom commentedon 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 commentedon 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 commentedon 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 commentedon Nov 2, 2018
Me, another Angular 7 developer facing same problem.
It has been 10 months...
SomeoneIsWorking commentedon Nov 22, 2018
Experiencing this with 'symlinks: false'
LaKing commentedon Dec 9, 2018
Finally I found this. Fix from @jukibom works!
floribon commentedon 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!
bkniffler commentedon Jun 2, 2019
Just in case @jukibom command doesn't work on your platform, you can install
replacepackage from npm globally or locally and add this inpostinstall.Its 100% analog to @jukibom solution, so all credits to him!
raf64flo commentedon Jun 12, 2019
I fear @jukibom's workaround is not working anymore since commit 805b665 which removes dependency to chokidar and symlinks configuration..
@sokra any chance to have a symlink option with the new native watcher, before v2.0.0 goes GA?
cristian-spiescu commentedon Jan 19, 2020
followSymlinksoption.This piece of code should execute early, in the start script which ultimately launches webpack. In my case, I use https://github.com/gsoft-inc/craco, so I put it in
craco.config.jswhich is getting called quite early.Allow ng serve to watch symlinks target updates.