Watching symlinks doesn't work in dev mode
See original GitHub issueBug report
What is the current behavior?
Watching symlinks doesn’t work after multiple changes in development mode.
If the current behavior is a bug, please provide the steps to reproduce.
webpack.config.js
module.exports = {
entry: './main.js',
watchOptions: { followSymlinks: true, },
mode: "development",
output: {
path: __dirname,
filename: 'bundle.js',
},
resolve: { symlinks: false }
};
main.js
Symlink to ./data/123.js
data/123.js
console.log("A");
Run
webpack --watch
echo 'console.log("B")' > main.js
echo 'console.log("C")' > main.js
What is the expected behavior?
I expected bundle.js to contain console.log("C")
, but it contained console.log("B")
.
Other relevant information:
webpack version: 5.65.0 Node.js version: 17.3.0 Operating System: Ubuntu 20.04 Additional tools:
Strangely, this example works fine in production mode.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Git symbolic links in Windows - Stack Overflow
If you don't want to enable developer mode, you can simply set symlink permission to your account: Press Win + R, type gpedit....
Read more >Building with plugins requires symlink support. Please enable ...
Building with plugins requires symlink support.Please enable Developer Mode in your system settings. Run start ms-settings:developersto open ...
Read more >Enabling Symlinks on Windows - Perforce
Enabling Symlinks on Windows when using Helix Core clients.
Read more >Adding Symlinks into GIT properly | Adobe Experience Manager
Instructions on how and where to add symlinks when working on your ... Ubuntu Bash Shell environment does not need anymore Developer Mode)....
Read more >How do I get Apache to follow symlinks? - Super User
Yes. What error message do you see? You will need to do sudo chmod ugo+x /root; sudo chmod ugo+rx /root/mydir to make it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@andreialecu, your issue is not related to this one. What you are describing is actually expected and working as intended.
node_modules
are considered immutable and only get invalidated once the version in package manifest changes.See https://github.com/angular/angular-cli/issues/22104 and https://github.com/angular/angular-cli/issues/20962
Hi @alan-agius4, I still think Angular 13, 14 does have this issue outside of node_modules and folders without a package.json inside them. We have a symlinked model folder that is shared between and Angular app and a NodeJs project. The folder is not in node_modules.
When we change a file. For example, adding a property to a class … Angular recompiles but complains that the class does not contain this new property. Killing the build and starting again resolves the issue but this is starting to become a massive drag on productivity.
Is there anyway to utilise any of the strategies above in the Angular.json or disable caching for a specific folder?
Regards, Tarek