Skip to content

Build fails in Angular SSR application with route parameters #28948

Closed
@bampakoa

Description

@bampakoa

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I have added Angular SSR in an existing Angular app with routing enabled and when I run ng build I get the following error:

The 'products/:id' route uses prerendering and includes parameters, but 'getPrerenderParams' is missing. Please define 'getPrerenderParams' function for this route in your server routing configuration or specify a different 'renderMode'.

Minimal Reproduction

  1. Create a new Angular CLI 19 application
  2. Create a route in the app.routes.ts file with parameter
  3. Run ng add @angular/ssr
  4. Run ng build

Exception or Error


Your Environment

Angular CLI: 19.0.0
Node: 22.11.0
Package Manager: npm 10.9.0
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1900.0 (cli-only)
@angular-devkit/core         19.0.0 (cli-only)
@angular-devkit/schematics   19.0.0 (cli-only)
@schematics/angular          19.0.0 (cli-only)

Anything else relevant?

Please note that I answered No to the following question when installing SSR, which is the default value:

Would you like to use the Server Routing and App Engine APIs (Developer Preview) for this server application?

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions