ng build --watch --preserve-symlinks dies with EMFILE when watch mode starts
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 70/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, node.js, typescript
- Bereich
- build-system, cli, tooling
Rechercherichtung
Start by tracing setupWatcher and its chokidar ignore configuration, then reproduce the issue with ng build --watch --preserve-symlinks on the described monorepo. Done means the shared directory symlink remains watched while unrelated node_modules directories no longer exhaust file handles; add or update the relevant watcher test if one is found there.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hi team,
We have one monorepo. A web app and an API both compile a shared model folder. That folder has no package.json. The web app reaches it through a symlink, libs/model, pointing at ../../model next to the web app. The watch command is ng build --watch --preserve-symlinks. We need preserveSymlinks so that link keeps working. On 22.1.7 this watch runs fine.
After moving @angular/cli and @angular/build to 22.2.0, the bundle still completes (about 92 seconds). Then the process dies as soon as watch mode starts:
Watch mode enabled. Watching for file changes...
Error: EMFILE: too many open files, watch
at FSWatcher._handle.onchange (node:internal/fs/watchers:267:21)
The stack goes through chokidar. We're on macOS, Node 24.16.0. ulimit -n 65536 does not stop it.
22.2 uses chokidar for this case so a directory symlink is still rebuilt. That part is what #34060 fixed for #34039, and the rebuilds do show up. The new problem is everything else the watcher opens. In setupWatcher, **/node_modules/** is only added to the ignore list when preserveSymlinks is false. The comment says that is so npm link keeps working. With the flag on, chokidar calls fs.watch for every directory under node_modules. Ours is large enough that the process runs out of file handles.
This symlink is not an npm link, and it is not inside node_modules. Ignoring node_modules would still follow libs/model to the shared model folder. Could the watcher skip node_modules when preserveSymlinks is on, and only watch a package that was actually created with npm link?
We've gone back to 22.1.7 for now.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 27k
- Forks
- 11.8k
- Ø Merge
- 21 Std. 32 Min.
- Gemergte PRs (30 T.)
- 162
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus angular/angular-cli
-
area: @angular/build gemini-triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
angular/angular-cli#33955 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: @angular/cli gemini-triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
angular/angular-cli#33055 · 1 Kommentar · 3 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: @angular-devkit/build-angular gemini-triaged
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
angular/angular-cli#34195 ·
Maintainer antworten meist innerhalb von 1 Tag
-
library builder: tslib is not added to the output package.jsonEvtl. vergeben @alan-agius4 hat das vor 8 Tagen übernommen. Offenangular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
library builder: a name re-exported through two "export *" paths is dropped from the bundleEvtl. vergeben @alan-agius4 hat das vor 8 Tagen übernommen. Offenangular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in angular/angular-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
openedx/frontend-app-authoring#3274 ·
Maintainer antworten meist innerhalb von 1 Tag
-
🎙️ task - fix(deployer): deploy --env prep runs deploy:dev where the repo declares deploy:prepOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
area/documentation status/need-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
google-gemini/gemini-cli#29548 ·
Maintainer antworten meist innerhalb von 1 Tag
-
sdk-typescript vector-store
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 82/100
mem0ai/mem0#7495 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag