Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): ensure all SSR chunks are resolve…
Browse files Browse the repository at this point in the history
…d correctly with dev server

The `server-utils` SSR generated chunk was not previously included in the ESM in memory loader for
prerendering which resulted in the ESM resolver incorrectly attempting to resolve non-relative
dependencies. This would lead to resolution errors when using the development server with caching
enabled. In this scenario, the Angular dependencies would be marked external and the server utilities
output chunk would contain non-relative imports and fail to prerender.

(cherry picked from commit 974acb7)
  • Loading branch information
clydin authored and alan-agius4 committed Nov 1, 2023
1 parent 60ca3c8 commit 05ce9d6
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -23,7 +23,7 @@ export interface ESMInMemoryFileLoaderWorkerData {
}

const TRANSFORMED_FILES: Record<string, string> = {};
const CHUNKS_REGEXP = /file:\/\/\/(main\.server|chunk-\w+)\.mjs/;
const CHUNKS_REGEXP = /file:\/\/\/((?:main|render-utils)\.server|chunk-\w+)\.mjs/;
let workspaceRootFile: string;
let outputFiles: Record<string, string>;

Expand Down

0 comments on commit 05ce9d6

Please sign in to comment.