Visitar URL original
fix(@angular/build): watchers outside the workspace via parcel didn't work by sod · Pull Request #34187 · angular/angular-cli · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(@angular/build): watchers outside the workspace via parcel didn't…
… work

The `dirKey` entry in `this.pendingSubscriptions` caused the following `if` to never be true, as `this.isCoveredByExistingExternal(dirKey)` is always true as long as `dirKey` is in there. But at this point it isn't pending anymore, as we just `await`ed it the LoC prior.

This bug caused the `else` to always run, which did `sub.unsubscribe()`, which killed the just spawned watcher. The effect was that a directory outside the workspace wasn't watched anymore.

E.g. this structure:

```
apps/my-angular-app
libs/my-angular-sdk
node_modules/@my/sdk => symlink to libs/my-angular-sdk
```

When you ran `ng serve` in `apps/my-angular-app` (which has imports to `@my/sdk`) and made a change in `libs/my-angular-sdk`, then the watcher didn't rebuild (which it did before in 21.x).
  • Loading branch information
sod committed Sep 28, 2026
commit 7428b476a2407b3597e66c0108822cb3b6c5fa3c
2 changes: 2 additions & 0 deletions packages/angular/build/src/utils/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ class ParcelExternalManager {

try {
const sub = await subPromise;
this.pendingSubscriptions.delete(dirKey);

if (this.externalDirFiles.has(dirKey) && !this.isCoveredByExistingExternal(dirKey)) {
this.extraSubscriptions.set(dirKey, sub);

Expand Down
Loading