Title: `ng generate application` produces a missing stylesheet when a workspace component type is configured · Issue #34684 · angular/angular-cli · GitHub
Open Graph Title: `ng generate application` produces a missing stylesheet when a workspace component type is configured · Issue #34684 · angular/angular-cli
X Title: `ng generate application` produces a missing stylesheet when a workspace component type is configured · Issue #34684 · angular/angular-cli
Description: 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...
Open Graph Description: 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/...
X Description: 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 "@schema...
Opengraph URL: https://github.com/angular/angular-cli/issues/34684
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ng generate application` produces a missing stylesheet when a workspace component type is configured","articleBody":"Hi Angular team! \n\nI found a case where a newly generated application fails to build when the workspace has a default component `type` configured.\n\n### Command\n\ngenerate, build\n\n### Description\n\nWith `\"@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`.\n\nAs a result, the application fails its first build with NG2008. Both `app.ts` and an extra `app.component.ts` are generated.\n\n### Minimal Reproduction\n\n1. Create a workspace:\n\n ```sh\n ng new component-type-repro --create-application=false --defaults --package-manager=npm --skip-git\n cd component-type-repro\n ```\n\n2. Add the following at the **top level** of `angular.json` (alongside `projects`):\n\n ```json\n \"schematics\": {\n \"@schematics/angular:component\": {\n \"type\": \"component\"\n }\n }\n ```\n\n3. Generate and build an application:\n\n ```sh\n ng generate application demo --file-name-style-guide=2025 --style=css --ssr=false --skip-install\n ng build demo --configuration=development\n ```\n\n**Actual behavior**\n\nThe generated files include:\n\n```text\nprojects/demo/src/app/app.ts\nprojects/demo/src/app/app.component.ts\nprojects/demo/src/app/app.component.css\n```\n\nThere is no `app.css`, but `app.ts` contains:\n\n```ts\nstyleUrl: './app.css',\n```\n\n**Expected behavior**\n\nThe 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.\n\nThe workspace component default should still apply when generating ordinary components separately.\n\n### Exception or Error\n\n```text\n✘ [ERROR] NG2008: Could not find stylesheet file './app.css'. [plugin angular-compiler]\n\n projects/demo/src/app/app.ts:7:12:\n 7 │ styleUrl: './app.css',\n ╵ ~~~~~~~~~~~\n```\n\n### Your Environment\n\nReproduced with the locally built CLI from `main` at d5035923f0e357b2526c98110125eee04b05192f, using the repository's Bazel E2E runner. Its `ng version` output reports:\n\n```text\nAngular CLI : 22.3.0-next.5\nAngular : 22.3.0-next.4\nNode.js : 24.15.0\nPackage Manager : npm 12.0.2\nOperating System : darwin x64\n```\n\nI have not established the last working version.\n\n### Anything else relevant?\n\n- #31053 introduced the file naming style option and describes the 2025 root component filename as `app.ts`.\n- #34450 and #34472 addressed similar inheritance of the workspace component `type` in the app-shell and routed-module schematics. This report concerns the application schematic.\n\nThe 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.\n\nI have a local fix and an E2E regression test for this case and will follow up with a PR. Thanks for taking a look!\n\n","author":{"url":"https://github.com/nagahara-naoki","@type":"Person","name":"nagahara-naoki"},"datePublished":"2026-11-11T11:58:52Z","url":"https://github.com/angular/angular-cli/issues/34684"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:56480aa0-b108-d0ac-e90a-8ca8b5d6c47c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 97FE:29FFA9:356FC47:43AF9C2:6B01DE67 |
| html-safe-nonce | 21d684aedd7146952cb14795f45eb52e5ba0b7b6b79d393a27d483209a328ae2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0ZFOjI5RkZBOTozNTZGQzQ3OjQzQUY5QzI6NkIwMURFNjciLCJ2aXNpdG9yX2lkIjoiOTA5NDgxNDQ5MzQzMDYzNjEzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 144272c9c147f7ab8a5b419501153ff35a4885623696f8dada931a7013d739f4 |
| hovercard-subject-tag | issue:6327941538 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34684/issue_layout |
| twitter:image | https://opengraph.githubassets.com/59f07ae4389ad36f727626d0226a625cf49a8e16040e4eeb9b968385053edb0c/angular/angular-cli/issues/34684 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/59f07ae4389ad36f727626d0226a625cf49a8e16040e4eeb9b968385053edb0c/angular/angular-cli/issues/34684 |
| og:image:alt | 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/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nagahara-naoki |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width