ng build --watch --preserve-symlinks dies with EMFILE when watch mode starts
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- angular, node.js, typescript
- Área
- build-system, cli, tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 27k
- Forks
- 11.8k
- Merge medio
- 20 h 38 min
- PR fusionados (30 d)
- 154
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-serverAbiertoarea: @angular/build gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
angular/angular-cli#33955 ·
Los mantenedores suelen responder en 1 día
-
area: @angular/cli gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/angular-cli#33055 · 1 comentario · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
area: @angular/build gemini-triaged
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
angular/angular-cli#34166 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
library builder: tslib is not added to the output package.jsonPosiblemente ocupada @alan-agius4 la tomó hace 7 días. Abiertoangular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
library builder: a name re-exported through two "export *" paths is dropped from the bundlePosiblemente ocupada @alan-agius4 la tomó hace 7 días. Abiertoangular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de angular/angular-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
rohitg00/agentmemory#1428 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
boxlite-ai/boxlite#1729 ·
Los mantenedores suelen responder en 1 día
-
Detect Deno tasks from deno.jsonAbiertodetectors enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
SM260845/readme-gen#1 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
angular/angularfire#3774 ·
Los mantenedores suelen responder en 2 días