-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSR build prerender broken if configuration has externalDependencies options #29092
Comments
This commit introduces `ngServerMode` to ensure proper handling of external `@angular/` packages when they are used as externals during server-side rendering (SSR). Closes: angular#29092
This commit introduces `ngServerMode` to ensure proper handling of external `@angular/` packages when they are used as externals during server-side rendering (SSR). Closes: angular#29092
This commit introduces `ngServerMode` to ensure proper handling of external `@angular/` packages when they are used as externals during server-side rendering (SSR). Closes: angular#29092
It seems that the problem is not resolved as I initially perceived. I may not have described the issue correctly. For the SSR build, a worker is used, which launches the server in a separate process. As I understand, the result of this worker is a list of routes for angular-app-manifest.mjs. The worker uses a custom loader. In our case, we are using a microfrontend architecture. Parts of the application are built and stored on a CDN in one place. We also use a custom loader that emulates the functionality of importmap to load these mini applications. For example:
Since we use a custom loader, we were able to load modules using regular HTTP. This worked in version 18. However, now the worker cannot load this module because your loader does not recognize 'uiForgeAppErd/ErdRoutes', causing the build to fail. If we use partialSSRBuild=true, the build completes, but the SSR server does not work because angular-app-manifest.mjs does not contain routes. As a result, the SSR server returns a 404 status. Is it possible to use SSR without routes in angular-app-manifest.mjs? Additionally, the build fails if we use an external dependency that can also be resolved through our loader and importmap.
|
Hi @klerick, I was wondering if this works with As a workaround, you could try setting the environment variable |
@alan-agius4 Now Its working correct)) |
Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Dear Angular Team,
We are experiencing an issue with external dependencies when using Angular 19. In our project, we utilize importmap to load external dependencies and have a custom registry hook for resolving these dependencies on our SSR server. However, we encounter an error when attempting to build the project in version 19.
Causes of the Issue:
Dependency Filtering:
Prerendering:
Custom Hook:
Minimal Reproduction
https://stackblitz.com/edit/stackblitz-starters-iudtwvic?file=package.json
npm run build.
Exception or Error
Your Environment
Possible Solutions
Expose partialSSRBuild Configuration:
Enhance or Extend Custom Hook:
The text was updated successfully, but these errors were encountered: