Angular Build --watch caches initial version of files in a symlinked folder. Subsequent changes are not reflected until full rebuild
See original GitHub issueCommand
build
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
Angular 12
Description
Hi Team,
We are having issues with Angular not loading changes of symlinked files. It appears to build the first time and cache the output. Changing the file shows Angular rebuilding but it uses the old version. You have to kill ng build and start again.
Our project is in single Git repository. It consists of an Angular 14 front end and a Node backed API using NestJS. We also have model folder that contains shared DTO’s and utilities.
The simplified folder structure is as follows -
/
angularapp
libs/
model (symlink of /model)
nodeapp
libs/
model (symlink of /model)
model
We have been using the structure since Angular 2 and I believe it worked up until you switch to WebPack 5.
Minimal Reproduction
- Create an Angular Project
- Create a folder outside the project called model
- Symlink the folder inside the Angular project eg - /angularapp/model
- Add files to the model folder.
- Do a build in watch mode
- Change the contents of a file in the model folder
- Wait for watcher to finish build
- Refresh the browser and the change will not be visible
- Cancel the watch build
- Build again
- Refresh the browser and the change will be visible.
Exception or Error
No response
Your Environment
Angular CLI: 14.2.1
Node: 16.15.1
Package Manager: npm 8.11.0
OS: darwin arm64
Angular: 14.2.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic
... platform-server, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1402.1
@angular-devkit/build-angular 14.2.1
@angular-devkit/core 14.2.1
@angular-devkit/schematics 14.2.1
@angular/cli 14.2.1
@schematics/angular 14.2.1
rxjs 7.5.5
typescript 4.6.2
Anything else relevant?
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:15
Top Results From Across the Web
Watching symlinks doesn't work in dev mode · Issue #15100
Angular Build --watch caches initial version of files in a symlinked folder. Subsequent changes are not reflected until full rebuild ...
Read more >Angular build watch for multiple libraries and and serve to ...
But the problem is when a libary is rebuilt, It first erase the linked files in dist folder (which linked by npm locally)...
Read more >ng build does not detect changes? : r/angular
After saving the files in VS Code, I run "ng build", but when I go to the website, it does not show the...
Read more >Changelog | Meteor API Docs
Improved tracking of which files are used by build plugins to know when it should do a full rebuild, a faster client-only rebuild,...
Read more >HTTP - Developers - Dropbox
The Dropbox API allows developers to work with files in Dropbox, including advanced functionality like full-text search, thumbnails, and sharing.
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 Free
Top 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
You can patch the
node_modules
until it has been fixed and released.Hash works fine in combination with the watchOptions.followSymlinks