Skip to content
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

Build fails in Angular SSR application with route parameters #28948

Closed
1 task
bampakoa opened this issue Nov 24, 2024 · 0 comments · Fixed by #28954
Closed
1 task

Build fails in Angular SSR application with route parameters #28948

bampakoa opened this issue Nov 24, 2024 · 0 comments · Fixed by #28954
Assignees

Comments

@bampakoa
Copy link
Contributor

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?

@alan-agius4 alan-agius4 self-assigned this Nov 24, 2024
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 25, 2024
…etPrerenderParams` is undefined

Ensure that parameterized routes do not cause errors when the `getPrerenderParams` function is undefined, specifically in cases where the routing API is not utilized.

Closes angular#28948
clydin pushed a commit that referenced this issue Nov 25, 2024
…etPrerenderParams` is undefined

Ensure that parameterized routes do not cause errors when the `getPrerenderParams` function is undefined, specifically in cases where the routing API is not utilized.

Closes #28948
clydin pushed a commit that referenced this issue Nov 25, 2024
…etPrerenderParams` is undefined

Ensure that parameterized routes do not cause errors when the `getPrerenderParams` function is undefined, specifically in cases where the routing API is not utilized.

Closes #28948

(cherry picked from commit c685c70)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants