Angular-cli: Symlinked scss still not triggering recompile on change

Created on 23 Oct 2020  Β·  6Comments  Β·  Source: angular/angular-cli

🐞 Bug report

(Copy of #18229 as the exact same issue is still there with ng 10.2)

Command

  • [ ] new
  • [x] build (with --watch)
  • [x] serve
  • [ ] test
  • [ ] e2e
  • [ ] generate
  • [ ] add
  • [ ] update
  • [ ] lint
  • [ ] xi18n
  • [ ] run
  • [ ] config
  • [ ] help
  • [ ] version
  • [ ] doc

Description

Imagine the following filesystem structure:

testFolder/
β”œβ”€β”€ realFolder1/
β”‚   └── style1.scss
β”œβ”€β”€ realFolder2/
β”‚   └── style2.scss
└── ngApp/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ styles.scss
    β”‚   β”œβ”€β”€ link1
    β”‚   └── link2
    └── .....

link1 & link2 are symbolic links, linking to realFolder1 and realFolder2, respectively.
The styles.scss in the actual angular app imports the style1.scss from the linked folder link1.
The style1.scss imports the style2.scss from the linked folder link2.
styles.scss contains actual style definitions.

Now when serving (or building with --watch) everything gets compiled correctly, but changes to the styles2.scss are ignored and not rebuild. Only when triggering a change in a different file the changes from style2.scss are sometimes also recompiled.
Actually in my repro app this is even true for changes to style1.scss! However, on my "real" project where I discovered this, the issue only occurs on the second level of symlinked references...

πŸ”¬ Minimal Reproduction

To reproduce this issue you can do the following:
Either you recreate the above structure or you clone my example app for this issue. In this example app for whatever reason symlinked scss files, do not trigger a recompile at all. In the real app this definitely works on some occasions where it is just one symlinked file, but fails when configured as above.
I updated the repo to angular 10.2

🌍 Your Environment


Angular CLI: 10.2.0
Node: 12.19.0
OS: win32 x64

Angular: 10.2.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1002.0
@angular-devkit/build-angular   0.1002.0
@angular-devkit/core            10.2.0
@angular-devkit/schematics      10.2.0
@schematics/angular             10.2.0
@schematics/update              0.1002.0
rxjs                            6.6.3
typescript                      3.9.6

Anything else relevant?
Reproducible with Windows 10 and WSL
Apparently something changed in the cli but the problematic behavior did not change at all.

devkibuild-angular dev-server low help wanted investigation broken bufix

All 6 comments

Hi @LoaderB0T,

I’ll try to look at this again in the coming days. I did try your reproduction locally (the other day) and worked as expected. Maybe it’s an OS specific issue or I missed something.

Can you try to see if you can reproduce this with version 11?

ng update @angular/cli β€”-next

Also, can you try to enable polling via the -β€”poll option?

I do remember that I saw a couple of WSL issues in their repo that caused file changes not to be picked up in the past.

Hi @alan-agius4
Thanks for the quick reply and your time invest. The issue is unchanged with version 11, I just checked.

Also, this issue is present in both a regular win 10 environment as well as in WSL (both with and without the --poll option)

Thanks again for your time and help, let me know if I can help with anything within my possibilities :)

Hi @LoaderB0T,

I looked at this again, and I am unable to replicate this locally. that said I use macOS. Will leave this open for now, maybe we can replicate this on a Windows VM in the future or a community member wants to give it a go.

I will try to reproduce this in a Linux VM to see if it is OS-specific.
Would be great if someone could try to reproduce this on windows πŸ‘

Hi, I was able to reproduce this issue on my windows 10 environment with the reproduction-repo.
No matter which of the linked scss files I change, no re-compile is triggered. When I change the styles.scss file, all changes get recognized and get compiled into the application.

Was this page helpful?
0 / 5 - 0 ratings