Skip to content

ng add @angular/ssr not working anymore after upgrade to v20 #30526

Closed
@alcfeoh

Description

@alcfeoh

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

upgrade, Don't known / other

Is this a regression?

Yes

Description

I upgraded this project to v20 to demo SSR for a public talk: https://github.com/alcfeoh/ngx-training/tree/ssr-workshop

And after running ng add @angular/ssr, the project doesn't compile anymore, and ng serve throws an error.

Please provide a link to a minimal reproduction of the bug

https://github.com/alcfeoh/ngx-training/tree/ssr-upgrade-error

Please provide the exception or error you saw

ng serve
Application bundle generation failed. [1.638 seconds]

✘ [ERROR] File 'src/main.server.ts' is missing from the TypeScript compilation. [plugin angular-compiler]

    angular:main-server:angular:main-server:8:24:
      8 │ export { default } from './src/main.server';

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

Angular CLI: 20.0.2
Node: 22.16.0
Package Manager: npm 10.9.2
OS: darwin arm64

Angular: 20.0.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2000.2
@angular-devkit/core         18.2.7
@angular-devkit/schematics   20.0.2
@angular/build               20.0.2
@angular/cli                 20.0.2
@angular/ssr                 20.0.2
@schematics/angular          20.0.2
rxjs                         7.8.2
typescript                   5.8.3
zone.js                      0.15.1

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions