Closed zip-fa closed 11 hours ago
It is by design that the prerender option is ignored.
The outputMode
is only intended to be used with the new SSR APIs, where the rendering modes are configured at route level.
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? About "undefined" error: i will make repro in some time & add another comment
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.
Alright, it took me 2 hours to find the cause of "undefined" error.
I've modified prerender.js directly in node_modules :))
To find this:
I've added catchError with isPlatformServer check to my global http interceptor and now everything works perfect:
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