Skip to content

Angular v18 SSR - Prerendering routesFile routes.txt when route starts with "id". Ex: "/:userId/home" #28591

Closed as not planned
@sonnyk22

Description

@sonnyk22

Command

build

Description

Based on the feedback in this link #28346, Angular v19 will provide a much better and easier way to handle the prerendering when it comes to the routes that starts with "id". But this version will not be released until Nov 19th or so.

Using the below section in the angular.json file:

"prerender": {
    "routesFile": "routes.txt",
    "discoverRoutes": false
},
"ssr": {
    "entry": "server.ts"
}

In Angular v18.x, it is is really easy to get prerendered for such basic routes as below:

   /auth
   /contact  
   /info/:id

However, is there a way to prerender when the "id" is right at the beginning of the route? For example:

   /:userId/profile
   /:userId/home
   /:userId/account

This is a unique request to prerender that I have not found any solution to on search engines.

Describe the solution you'd like

While waiting for Angular v19 to be released, it would be nice to be able to prerender in v18.x via the routesFile routes.txt for the example routes below:

   /:userId/profile
   /:userId/home
   /:userId/account

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

Labels

needs: repro stepsWe cannot reproduce the issue with the information given

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions