question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Watching symlinks doesn't work in dev mode

See original GitHub issue

Bug 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:open
  • Created 2 years ago
  • Reactions:3
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
alan-agius4commented, Jan 24, 2022

@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

1reaction
thaoulacommented, Jul 14, 2022

@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 angular/angular-cli#22104 and angular/angular-cli#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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found