From 7428b476a2407b3597e66c0108822cb3b6c5fa3c Mon Sep 17 00:00:00 2001 From: Alexander von Weiss Date: Mon, 28 Sep 2026 11:45:36 +0200 Subject: [PATCH] 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). --- packages/angular/build/src/utils/watcher.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/angular/build/src/utils/watcher.ts b/packages/angular/build/src/utils/watcher.ts index 8d47ba48e907..07fb8a3e0768 100644 --- a/packages/angular/build/src/utils/watcher.ts +++ b/packages/angular/build/src/utils/watcher.ts @@ -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);