-
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
"prerender": false is ignored with "outputMode": "server" #28590
Comments
It is by design that the prerender option is ignored. The That being said, the error is definitely not helpful, can you please provide a minimal reproduction? |
My current serverRoutes config is: import type { ServerRoute } from '@angular/ssr';
import { RenderMode } from '@angular/ssr';
export const serverRoutes: ServerRoute[] = [
{
path: '**',
renderMode: RenderMode.Server,
headers: {
'Cache-Control': 'no-store, no-cache, must-revalidate, proxy-revalidate',
'Pragma': 'no-cache',
'Expires': '0',
'Surrogate-Control': 'no-store'
}
}
]; app.config.server is: import { mergeApplicationConfig } from '@angular/core';
import { provideServerRendering } from '@angular/platform-server';
import { provideServerRoutesConfig } from '@angular/ssr';
import { appConfig } from './app.config';
import { serverRoutes } from './app.routes.server';
export const config = mergeApplicationConfig(appConfig, {
providers: [provideServerRendering(), provideServerRoutesConfig(serverRoutes)]
}); Shouldn't prerender be completly disabled with this configuration? |
With this config, indeed none of the routes will be pre-rendered. Although the application will still be bootstrapped during the build to generate the SSR manifest. |
I've added catchError with isPlatformServer check to my global http interceptor and now everything works perfect:
|
Handle cases where the error stack is missing by displaying a relevant message. Closes angular#28590
Handle cases where the error stack is missing by displaying a relevant message. Closes #28590
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Hi.
"prerender": false is ignored with "outputMode": "server": angular tries to prerender all my routes and i receive "undefined" message on routes extraction step:
ng build command now only reacts to "export NG_BUILD_PARTIAL_SSR=true && ng build" - build does not fail with this setup
Minimal Reproduction
ng build
Exception or Error
No response
Your Environment
v19.0.0-next.8
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: