Skip to content

Angular Build --watch caches initial version of files in a symlinked folder. Subsequent changes are not reflected until full rebuild #23896

Description

@thaoula

Command

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

  1. Create an Angular Project
  2. Create a folder outside the project called model
  3. Symlink the folder inside the Angular project eg - /angularapp/model
  4. Add files to the model folder.
  5. Do a build in watch mode
  6. Change the contents of a file in the model folder
  7. Wait for watcher to finish build
  8. Refresh the browser and the change will not be visible
  9. Cancel the watch build
  10. Build again
  11. 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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions