Skip to content

SSR Not working in ng new generated app #31285

@SOG-web

Description

@SOG-web

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

platform-server

Is this a regression?

Yes

Description

Generating a new anguar app with ssr is not working

Please provide a link to a minimal reproduction of the bug

https://github.com/SOG-web/ang

Please provide the exception or error you saw

Error: NG0401: Missing Platform: This may be due to using `bootstrapApplication` on the server without passing a `BootstrapContext`. Please make sure that `bootstrapApplication` is called with a `context` argument.
    at internalCreateApplication (/Users/rou/Documents/Github/vine/apps/vendor/.angular/cache/20.3.2/vendor/vite/deps_ssr/chunk-VJJSQ2HF.js:34762:11)
    at bootstrapApplication (/Users/rou/Documents/Github/vine/apps/vendor/.angular/cache/20.3.2/vendor/vite/deps_ssr/chunk-4PN23EPO.js:1130:35)
    at bootstrap (/Users/rou/Documents/Github/vine/apps/vendor/src/main.server.ts:5:25)
    at getRoutesFromAngularRouterConfig (/Users/rou/Documents/Github/vine/apps/vendor/.angular/cache/20.3.2/vendor/vite/deps_ssr/chunk-LOOLFI6T.js:28479:30)
    at extract (/Users/rou/Documents/Github/vine/apps/vendor/.angular/cache/20.3.2/vendor/vite/deps_ssr/chunk-LOOLFI6T.js:28563:63)
    at async AngularServerApp.handle (/Users/rou/Documents/Github/vine/apps/vendor/.angular/cache/20.3.2/vendor/vite/deps_ssr/chunk-LOOLFI6T.js:29049:21)

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

Angular CLI: 20.3.2
Node: 22.19.0
Package Manager: pnpm 10.17.1
OS: darwin x64
    

Angular: 20.3.1
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-server, router

Package                      Version
------------------------------------
@angular-devkit/architect    0.2003.2 (cli-only)
@angular-devkit/core         20.3.2 (cli-only)
@angular-devkit/schematics   20.3.2 (cli-only)
@angular/build               20.3.2
@angular/cdk                 20.2.4
@angular/cli                 20.3.2
@angular/ssr                 20.3.2
@schematics/angular          20.3.2 (cli-only)
rxjs                         7.8.2
typescript                   5.9.2

Anything else?

Please this is delaying production

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions