Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): allow SSR compilation to work wit…
Browse files Browse the repository at this point in the history
…h TS allowJs option

When using the `application` builder with SSR enabled and the `allowJs` TypeScript option,
the build would previously generate warnings about undefined imports. This was caused by
the recently introduced initialization error handling that was not accounting for the early
exit of the SSR compiler plugin's `onStart` hook. This early exit prevent the error status
checking from completing which resulted in the SSR plugin load hook assuming an error had
occurred. This in turn caused JavaScript files that were not imported into TypeScript
files to be returned as empty content to avoid the not found error message. To remedy this
situation, the error status is now also set during the SSR early exit.

(cherry picked from commit 3470bff)
  • Loading branch information
clydin authored and alan-agius4 committed Nov 7, 2023
1 parent ec5e302 commit 9d4d11c
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export function createCompilerPlugin(

if (compilation instanceof NoopCompilation) {
await sharedTSCompilationState.waitUntilReady;
hasCompilationErrors = false;

return result;
}
Expand Down

0 comments on commit 9d4d11c

Please sign in to comment.