Skip to content

Issue: Can't build/run a basic standalone Angular app SSR (or not)  #26318

Closed as not planned
@tom-laplace

Description

@tom-laplace

Command

build, serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I can't build/run a basic project using Angular 17. Even just after initialization.

Minimal Reproduction

  • ng new crash-test --standalone --ssr OR ng new crash-test --standalone
  • npm i
  • npm run build OR npm run start

Exception or Error

src/app/app.component.ts:1:26:
      1 │ import { Component } from '@angular/core';
        ╵                           ~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@angular/core" here because it's not listed as a dependency of this package:

    ../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@angular/core" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@angular/common"

    src/app/app.component.ts:2:29:
      2 │ import { CommonModule } from '@angular/common';
        ╵                              ~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@angular/common" here because it's not listed as a dependency of this package:

    ../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@angular/common" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.


✘ [ERROR] Could not resolve "@angular/router"

    src/app/app.component.ts:3:29:
      3 │ import { RouterOutlet } from '@angular/router';
        ╵                              ~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@angular/router" here because it's not listed as a dependency of this package:

    ../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@angular/router" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.


✘ [ERROR] Could not resolve "@angular/router"

    src/app/app.config.ts:1:30:
      1 │ import { provideRouter } from '@angular/router';
        ╵                               ~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@angular/router" here because it's not listed as a dependency of this package:

    ../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@angular/router" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.


✘ [ERROR] Could not resolve "@angular/common/http"

    src/app/app.config.ts:3:34:
      3 │ import { provideHttpClient } from '@angular/common/http';
        ╵                                   ~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@angular/common" here because it's not listed as a dependency of this package:

    ../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@angular/common/http" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.


✘ [ERROR] Could not resolve "@angular/platform-browser"

    src/main.ts:1:37:
      1 │ import { bootstrapApplication } from '@angular/platform-browser';
        ╵                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@angular/platform-browser" here because it's not listed as a dependency of this package:

    ../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@angular/platform-browser" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.


✘ [ERROR] Could not resolve "zone.js"

    angular:polyfills:angular:polyfills:1:7:
      1 │ import 'zone.js';
        ╵        ~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "zone.js" here because it's not listed as a dependency of this package:

    ../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "zone.js" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

Your Environment

Angular CLI: 17.0.0
Node: 20.9.0
Package Manager: npm 10.1.0
OS: linux x64

Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1700.0
@angular-devkit/core         17.0.0
@angular-devkit/schematics   17.0.0
@angular/cli                 17.0.0
@schematics/angular          17.0.0

Anything else relevant?

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