Skip to content

BUG: ng build --ssr Fails with "ssr.entry" on Angular 20.1.1 - Reproducible on Windows and macOS M4 #30755

@BenGoldberg

Description

@BenGoldberg

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

Don't known / other

Is this a regression?

Yes

Description

When attempting to build an Angular application with Server-Side Rendering (SSR) enabled, using Angular CLI 20.1.1, the build consistently fails with the error: Error: The "ssr.entry" option is required when "outputMode" is set to "server".

This issue is easily reproducible on multiple machines with fresh installations of Node.js and Angular CLI, and a newly generated Angular SSR project. It occurred on my previous Windows laptop and my new M4 MacBook Pro.

Crucially, building the exact same type of project with Angular CLI 17.x works perfectly.

Reproduction Steps:

  1. Ensure a clean environment: This issue occurs even on a system with a fresh Node.js and npm installation (no previous global Angular CLI or project dependencies).

  2. Install Angular CLI 20.1.1 globally:

npm install -g @angular/[email protected]

  1. Create a new Angular project with SSR enabled:
ng new my-ssr-app --ssr
cd my-ssr-app
  1. Attempt to build the SSR application:

ng build --ssr

Expected Behavior:
The ng build --ssr command should complete successfully, generating the SSR bundles without errors, as it does with Angular 17.x.

Actual Behavior:
The build fails with the following error:

/Users/ben/Documents/GitHub/test-srr-app/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js:13
            throw err;
            ^

Error: The "ssr.entry" option is required when "outputMode" is set to "server".
    at normalizeOptions (/Users/ben/Documents/GitHub/test-srr-app/node_modules/@angular/build/src/builders/application/options.js:117:19)
    at async buildApplicationInternal (/Users/ben/Documents/GitHub/test-srr-app/node_modules/@angular/build/src/builders/application/index.js:47:31)
    at async buildApplication (/Users/ben/Documents/GitHub/test-srr-app/node_modules/@angular/build/src/builders/application/index.js:122:22)
    at async handleAsyncIterator (/Users/ben/Documents/GitHub/test-srr-app/node_modules/@angular-devkit/architect/src/api.js:38:28)

Node.js v22.17.1

Please provide a link to a minimal reproduction of the bug

https://github.com/BenGoldberg/test-srr-app

Please provide the exception or error you saw

/Users/ben/Documents/GitHub/test-srr-app/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js:13
            throw err;
            ^

Error: The "ssr.entry" option is required when "outputMode" is set to "server".
    at normalizeOptions (/Users/ben/Documents/GitHub/test-srr-app/node_modules/@angular/build/src/builders/application/options.js:117:19)
    at async buildApplicationInternal (/Users/ben/Documents/GitHub/test-srr-app/node_modules/@angular/build/src/builders/application/index.js:47:31)
    at async buildApplication (/Users/ben/Documents/GitHub/test-srr-app/node_modules/@angular/build/src/builders/application/index.js:122:22)
    at async handleAsyncIterator (/Users/ben/Documents/GitHub/test-srr-app/node_modules/@angular-devkit/architect/src/api.js:38:28)

Node.js v22.17.1

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

Angular CLI: 20.1.1
Node: 22.17.1
Package Manager: npm 10.9.2
OS: darwin arm64

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

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

Anything else?

As you can see in the angular.json file in the project the ssr.entry section is not missing!! It makes no sense why it says it is.

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