Skip to content

ng-server-context="ssr" on prerendered (SSG) parameterized routes #29426

Closed

Description

@vzarskus

Which @angular/* package(s) are the source of the bug?

platform-server

Is this a regression?

No

Description

Hello!

I have noticed that when prerendering with Angular19 parameterized routes feature (https://angular.dev/guide/hybrid-rendering#parameterized-routes), these prerendered index.htmls contain ng-server-context="ssr", which is odd, because I would expect them to have ng-server-context="ssg" - same as not parameterized routes.

I will give you some examples in pictures.

Here we see browser/translations/index.html have ng-server-context="ssg":
Image

Here we see two parameterized routes on browser/translations/irasu-valdymo-teorija/index.html and browser/translations/programines-irangos-inzinieriu-humoras/index.html having ng-server-context="ssr":

Image

Image

Is this intended?

Here is the relevant excerpt from app.routes.server.ts:

{
    path: 'translations/:slug',
    renderMode: RenderMode.Prerender,
    getPrerenderParams(): Promise<Record<string, string>[]> {
      return Promise.resolve(
        ['irasu-valdymo-teorija', 'programines-irangos-inzinieriu-humoras'].map(
          i => ({ slug: i }),
        ),
      );
    },
  },

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.1.1
Node: 20.18.0
Package Manager: npm 11.0.0
OS: win32 x64

Angular: 19.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser      
... platform-browser-dynamic, platform-server, router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.1
@angular-devkit/build-angular   19.1.1
@angular-devkit/core            19.1.1
@angular-devkit/schematics      19.1.1
@angular/cdk                    19.1.0
@schematics/angular             19.0.6
ng-packagr                      19.0.1
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else?

No response

Activity

  1. changed the title [-]ng-server-context="ssr" on parameterized routes[/-] [+]ng-server-context="ssr" on prerendered parameterized routes[/+] on Jan 21, 2025
  2. changed the title [-]ng-server-context="ssr" on prerendered parameterized routes[/-] [+]ng-server-context="ssr" on prerendered (SSG) parameterized routes[/+] on Jan 21, 2025
  3. added a commit that references this issue on Jan 21, 2025
    ab319dd
  4. self-assigned this
    on Jan 21, 2025
  5. added a commit that references this issue on Jan 21, 2025
    14d2f7c
  6. added a commit that references this issue on Jan 21, 2025
    395562a
  7. angular-automatic-lock-bot commented on Feb 21, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions