Skip to content

Commit 3e359da

Browse files
committed
fix(@angular/build): address rxjs undefined issues during SSR prebundling
Replacing the paths to ESM in Vite can cause prebundling to fail in some cases, resulting in errors similar to the following: ``` 12:55:12 PM [vite] Error when evaluating SSR module /chunk-CHB4JJIP.mjs: |- TypeError: Cannot read properties of undefined (reading 'Subject') at eval (//src/app/shared/snackbar/snackbar.service.ts:2:25) at async instantiateModule (file:////node_modules/vite/dist/node/chunks/dep-BcXSligG.js:53408:5) 12:55:12 PM [vite] Error when evaluating SSR module /chunk-GQZ5BKXC.mjs: |- TypeError: Cannot read properties of undefined (reading 'Subject') at eval (//src/app/shared/snackbar/snackbar.service.ts:2:25) at async instantiateModule (file:////node_modules/vite/dist/node/chunks/dep-BcXSligG.js:53408:5) ``` Closes: #27907
1 parent fd65792 commit 3e359da

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

packages/angular/build/src/builders/dev-server/vite-server.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
BuildOutputFileType,
2626
type ExternalResultMetadata,
2727
JavaScriptTransformer,
28-
createRxjsEsmResolutionPlugin,
2928
getFeatureSupport,
3029
getSupportedBrowsers,
3130
isZonelessApp,
@@ -659,10 +658,6 @@ function getDepOptimizationConfig({
659658
},
660659
];
661660

662-
if (ssr) {
663-
plugins.unshift(createRxjsEsmResolutionPlugin() as ViteEsBuildPlugin);
664-
}
665-
666661
return {
667662
// Exclude any explicitly defined dependencies (currently build defined externals)
668663
exclude,

0 commit comments

Comments
 (0)