fix(@angular/build): ensure chokidar watcher is ready before returning #34122

Merged
alan-agius4 opened 5:52pm on September 18, 2026 wanted to merge 1 commit into angular/angular-cli main from
fix-build-watcher-chokidar-ready
Diff Delta:
0
About 0 Diff Delta/hour
Classified as:  General

alan-agius4's Description of Work

When initializing chokidar.watch with ignoreInitial: true, files visited during the initial scan are treated as the initial baseline and do not emit change events. If createChokidarWatcher returns before the initial scan completes, subsequent file modifications made shortly after setup can be visited for the first time during the initial scan, causing the change event to be dropped.

Awaiting the ready event ensures the watcher's initial scan is completed and the watcher is actively listening before returning. This resolves test flakiness in rebuild error detection tests where files are modified immediately after the initial build.

2 total changed files
(2 files ignored)
That’s the last hunk
No additional context awaits in the abyss below