Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
adsafawqew opened this issue Aug 31, 2023 · 8 comments · Fixed by #26630

Comments

@adsafawqew
Copy link

Command

serve

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

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

@vfg12e9w
Copy link

vfg12e9w commented Dec 8, 2023

see #26585
see a8dbf1d

tested with angular v17.0.6 and #26585 (comment)
still not working
ChatGPT says: one step closer to madness

problem is probably:

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

@alan-agius4
Copy link
Collaborator

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

@alan-agius4 alan-agius4 added needs: repro steps We cannot reproduce the issue with the information given and removed type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: @angular-devkit/build-angular devkit/build-angular:dev-server labels Dec 8, 2023
@alan-agius4
Copy link
Collaborator

@3z6tfx6d, from the repro steps, it doesn’t look like your configuring the typescript path mappings are described in #26585 (comment)

@xx11sw3om
Copy link

repeat the steps and you will see that it does not work regardless of whether you write the typescript path mappings (#26585 (comment)) 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

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Dec 11, 2023
…ibrary from another workspace when `preserveSymlinks` is `true`

Prior to this change, watching of an `npm link` of a library in another workspace when `preserveSymlinks` was set to `true` was not being picked up as `node_modules` files were always ignored.

Closes angular#25753
@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: @angular-devkit/build-angular devkit/build-angular:dev-server and removed needs: repro steps We cannot reproduce the issue with the information given labels Dec 11, 2023
@alan-agius4 alan-agius4 self-assigned this Dec 11, 2023
alan-agius4 added a commit that referenced this issue Dec 11, 2023
…ibrary from another workspace when `preserveSymlinks` is `true`

Prior to this change, watching of an `npm link` of a library in another workspace when `preserveSymlinks` was set to `true` was not being picked up as `node_modules` files were always ignored.

Closes #25753
alan-agius4 added a commit that referenced this issue Dec 11, 2023
…ibrary from another workspace when `preserveSymlinks` is `true`

Prior to this change, watching of an `npm link` of a library in another workspace when `preserveSymlinks` was set to `true` was not being picked up as `node_modules` files were always ignored.

Closes #25753

(cherry picked from commit 2909daf)
@e23gap32oq
Copy link

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

@achrysanthakopoulou
Copy link

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

@jyounce-aim
Copy link

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.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
8 participants
@alan-agius4 @achrysanthakopoulou @jyounce-aim @adsafawqew @vfg12e9w @xx11sw3om @e23gap32oq and others