Skip to content

Commit 974acb7

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): ensure all SSR chunks are resolved 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.
1 parent 5b4f50c commit 974acb7

File tree

1 file changed

+1
-1
lines changed
  • packages/angular_devkit/build_angular/src/utils/server-rendering/esm-in-memory-loader

1 file changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface ESMInMemoryFileLoaderWorkerData {
2323
}
2424

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

0 commit comments

Comments
 (0)