Skip to content

ng serve - Cannot GET / #28922

@willemtoerien

Description

@willemtoerien

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

platform-server

Is this a regression?

Yes

Description

I get Cannot GET / when I run the application on first install and start.

  1. ng new test
  2. Which stylesheet format would you like to use? Sass (SCSS)
  3. Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? yes
  4. Would you like to use the Server Routing and App Engine APIs (Developer Preview) for this server application? yes
  5. npm start

Image

  1. npm run build
  2. npm serve:ssr:test

Image

From what I can see in the following code, response is null.

app.use('/**', (req, res, next) => {
  angularApp
    .handle(req)
    .then((response) =>
      response ? writeResponseToNodeResponse(response, res) : next(),
    )
    .catch(next);
});

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Cannot GET /

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

Angular CLI: 19.0.0
Node: 23.1.0 (Unsupported)
Package Manager: npm 10.9.0
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1900.0 (cli-only)
@angular-devkit/core         19.0.0 (cli-only)
@angular-devkit/schematics   19.0.0 (cli-only)
@schematics/angular          19.0.0 (cli-only)

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions