GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `ng generate application` produces a missing stylesheet when a workspace component type is configured · Issue #34684 · angular/angular-cli

ng generate application produces a missing stylesheet when a workspace component type is configured #34684

New issue
Copy link
New issue
Copy link
Open
#34685
Open
ng generate application produces a missing stylesheet when a workspace component type is configured#34684
#34685
Copy link
Labels
area: @schematics/angular
Milestone
needsTriage

Description

@nagahara-naoki
nagahara-naoki
opened on Nov 11, 2026
Issue body actions

Hi Angular team!

I found a case where a newly generated application fails to build when the workspace has a default component type configured.

Command

generate, build

Description

With "@schematics/angular:component": { "type": "component" } in the workspace-level schematics section of angular.json, generating an application with the 2025 file naming style produces app.component.css, but the generated app.ts references ./app.css.

As a result, the application fails its first build with NG2008. Both app.ts and an extra app.component.ts are generated.

Minimal Reproduction

  1. Create a workspace:

    ng new component-type-repro --create-application=false --defaults --package-manager=npm --skip-git
    cd component-type-repro
  2. Add the following at the top level of angular.json (alongside projects):

    "schematics": {
      "@schematics/angular:component": {
        "type": "component"
      }
    }
  3. Generate and build an application:

    ng generate application demo --file-name-style-guide=2025 --style=css --ssr=false --skip-install
    ng build demo --configuration=development

Actual behavior

The generated files include:

projects/demo/src/app/app.ts
projects/demo/src/app/app.component.ts
projects/demo/src/app/app.component.css

There is no app.css, but app.ts contains:

styleUrl: './app.css',

Expected behavior

The root component files and their references should consistently follow the selected application naming style: app.ts, app.html, and app.css for 2025. The generated application should build successfully.

The workspace component default should still apply when generating ordinary components separately.

Exception or Error

✘ [ERROR] NG2008: Could not find stylesheet file './app.css'. [plugin angular-compiler]

    projects/demo/src/app/app.ts:7:12:
      7 │   styleUrl: './app.css',
        ╵             ~~~~~~~~~~~

Your Environment

Reproduced with the locally built CLI from main at d503592, using the repository's Bazel E2E runner. Its ng version output reports:

Angular CLI       : 22.3.0-next.5
Angular           : 22.3.0-next.4
Node.js           : 24.15.0
Package Manager   : npm 12.0.2
Operating System  : darwin x64

I have not established the last working version.

Anything else relevant?

  • feat(@schematics/angular): support different file name style guides in ng new #31053 introduced the file naming style option and describes the 2025 root component filename as app.ts.
  • fix(@schematics/angular): set explicit type for the app-shell component #34450 and fix(@schematics/angular): set explicit type for the module --route component #34472 addressed similar inheritance of the workspace component type in the app-shell and routed-module schematics. This report concerns the application schematic.

The application schematic explicitly sets the component type for the 2016 style, but leaves it unspecified for 2025. It appears that the workspace default is inherited during component generation while the application templates continue to use the 2025 filenames.

I have a local fix and an E2E regression test for this case and will follow up with a PR. Thanks for taking a look!

Activity

  1. angular-robot
    added
    area: @schematics/angular
    on Nov 11, 2026
  2. angular-robot
    added this to the needsTriage milestone on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @schematics/angular

    Type

    No type

    Projects

    No projects

      Milestone

      • needsTriageNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.