angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

esbuild doesn't watch for local library changes while running dev server (cli-cache-enabled=false,preserveSymlinks=true)

Open adsafawqew opened this issue 3 years ago • 8 comments

Command

serve

Is this a regression?

  • [X] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

see #25569

library changes are not reflected when using "cli-cache-enabled"=false and "preserveSymlinks"=true and esbuild when using "@angular-devkit/build-angular:browser" instead of "@angular-devkit/build-angular:browser-esbuild" everything works fine

angular.json

"cli": {
    "cache": {
        "enabled": false
    }
}
"options": {
    "preserveSymlinks": true
}

when using "cli-cache-enabled"=true and remove "preserveSymlinks" from otions everything works fine when using "cli-cache-enabled"=false and remove "preserveSymlinks" application won't start

when using "cli-cache-enabled"=true and "preserveSymlinks"=true changes are not detected when using "cli-cache-enabled"=true and "preserveSymlinks"=false everything works fine

when using "cli-cache-enabled"=false and "preserveSymlinks"=true changes are not detected when using "cli-cache-enabled"=false and "preserveSymlinks"=false application won't start

everything works fine = ts and html changes from library work, scss from library doesn't work

I expected to change "@angular-devkit/build-angular:browser" to "@angular-devkit/build-angular:browser-esbuild" and everything would work, but now I will end up in psychiatry because of esbuild

Minimal Reproduction

see #25569

Exception or Error

No response

Your Environment

Angular CLI: 16.2.1
Node: 18.17.1
Package Manager: npm 9.8.1
OS: win32 x64

Angular: 16.2.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1602.1
@angular-devkit/build-angular      16.2.1
@angular-devkit/core               16.2.1
@angular-devkit/schematics         16.2.1
@angular/cdk                       16.2.2
@angular/cli                       16.2.1
@angular/flex-layout               14.0.0-beta.41
@angular/material                  16.2.2
@angular/material-moment-adapter   16.2.2
@schematics/angular                16.2.1
rxjs                               7.8.1
typescript                         5.1.6
zone.js                            0.13.1

Anything else relevant?

No response

adsafawqew avatar Aug 31 '23 09:08 adsafawqew

see https://github.com/angular/angular-cli/issues/26585 see https://github.com/angular/angular-cli/commit/a8dbf1da27faf772a4df382b1301e95c32d1ba89

tested with angular v17.0.6 and https://github.com/angular/angular-cli/issues/26585#issuecomment-1840982411 still not working ChatGPT says: one step closer to madness

problem is probably:

"cli": {
    "cache": {
        "enabled": false
    }
}

vfg12e9w avatar Dec 08 '23 14:12 vfg12e9w

Hi @vfg12e9w, I am unable to replicate this, kindly provide a minimal reproduction.

alan-agius4 avatar Dec 08 '23 14:12 alan-agius4

@3z6tfx6d, from the repro steps, it doesn’t look like your configuring the typescript path mappings are described in https://github.com/angular/angular-cli/issues/26585#issuecomment-1840982411

alan-agius4 avatar Dec 09 '23 08:12 alan-agius4

repeat the steps and you will see that it does not work regardless of whether you write the typescript path mappings (https://github.com/angular/angular-cli/issues/26585#issuecomment-1840982411) or not

I'm crazy, but I'm not that crazy

therefore it is questionable whether #26585 is actually fixed or not, because the steps are more or less the same

xx11sw3om avatar Dec 09 '23 12:12 xx11sw3om

I can confirm that in version 17.0.7 it works with cli-cache-enabled=false and preserveSymlinks=true

e23gap32oq avatar Dec 14 '23 08:12 e23gap32oq

I have the same problem in 17.0.9 regardless of cli cache or preserveSymlinks properties. Mostly library html and scss changes give me a "No output file changes".

That doesn't seems like everything is working fine:

everything works fine = ts and html changes from library work, scss from library doesn't work

achrysanthakopoulou avatar Jan 10 '24 14:01 achrysanthakopoulou

Hi everyone,

I to am seeing this issue after upgrading to Angular v17.1.0.

My Local Setup: Mac Ventura v13.3 Angular v17.1.0 Node.js v20.11.0

fwiw, I have spent the last 6 hours trying to find a solution to no avail.

The problem: Local application serves fine with my local library symlinked in. Library builds fine when I make changes but the browser does not reload with those changes. Investigating in the chrome console Sources tab I see the problem under: webpack:// node_modules my-lib my-file.mjs (is not updated with the changes)

So it seems to be a webpack caching issue.

Any help would be greatly appreciated, thank you.

jyounce-aim avatar Jan 20 '24 05:01 jyounce-aim

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.