Skip to content

Commit fa234a4

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): ensure secondary Angular compilations are unblocked on start errors
When using the esbuild-based builders (`application`/`browser-esbuild`), the secondary Angular compilations will wait for the primary compilation to finish prior to bundling. This can potentially occur for polyfills that contain TypeScript files and the server code if enabled. However, if the Angular compilation throws an error during the start of the bundling process, the secondary compilations were never notified and instead would wait indefinitely. To avoid this situation, the compilations will now always be notified at the end of the compilation which will occur regardless. The build error that will be generated in these situations is currently not ideal and more verbose than needed but will provide information pertaining to the root cause. (cherry picked from commit 3b6a999)
1 parent c46f312 commit fa234a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/angular/compiler-plugin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ export function createCompilerPlugin(
418418
}
419419

420420
build.onEnd((result) => {
421+
// Ensure other compilations are unblocked if the main compilation throws during start
422+
sharedTSCompilationState?.markAsReady();
423+
421424
for (const { outputFiles, metafile } of additionalResults.values()) {
422425
// Add any additional output files to the main output files
423426
if (outputFiles?.length) {

0 commit comments

Comments
 (0)