René's URL Explorer Experiment


Title: `ng generate app-shell` and `ng generate module --route` produce broken imports when a component `type` is configured · Issue #34449 · angular/angular-cli · GitHub

Open Graph Title: `ng generate app-shell` and `ng generate module --route` produce broken imports when a component `type` is configured · Issue #34449 · angular/angular-cli

X Title: `ng generate app-shell` and `ng generate module --route` produce broken imports when a component `type` is configured · Issue #34449 · angular/angular-cli

Description: Command generate 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 19.x (before the v20 file naming change) Description ng generate app-shell and ng g...

Open Graph Description: Command generate 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 19.x (before the v20 file naming change) De...

X Description: Command generate 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 19.x (before the v20 file naming change) De...

Opengraph URL: https://github.com/angular/angular-cli/issues/34449

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ng generate app-shell` and `ng generate module --route` produce broken imports when a component `type` is configured","articleBody":"### Command\n\ngenerate\n\n### Is this a regression?\n\n- [x] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n19.x (before the v20 file naming change)\n\n### Description\n\n`ng generate app-shell` and `ng generate module \u003cname> --route \u003cpath> --module \u003cparent>` generate a component and then\nreference it with a hard-coded file path and class name. Both assume the v20+ defaults (no type in the file or class\nname). When the workspace configures a component `type`, the component inherits it and the hard-coded references no\nlonger match, so the build fails.\n\nWorkspaces get a component `type` in two common ways:\n\n1. Every workspace updated to v20 with `ng update`: the migration that keeps the previous style guide behaviour\n   (fdc6291dda) adds `\"@schematics/angular:component\": { \"type\": \"component\" }`.\n2. `ng new --file-name-style-guide=2016`, which adds `{ \"type\": \"component\", \"addTypeToClassName\": false }`.\n\nHard-coded references:\n\n- `packages/schematics/angular/app-shell/index.ts`: `withAppShell(AppShell)` and\n  `insertImport(..., 'AppShell', './app-shell/app-shell')`.\n- `packages/schematics/angular/module/files/.../__name@dasherize__-routing__typeSeparator__module.ts.template` (and the\n  non-routing module template for `--route` without a routing module): `import { \u003c%= classify(name) %> } from './\u003c%= dasherize(name) %>';`\n\nThe library schematic had the same problem (#26981) and was fixed in 661609e3e by passing an explicit `type: ''` to the\ncomponent schematic.\n\n### Minimal Reproduction\n\n**app-shell** (updated-workspace configuration):\n\n```sh\nng new ws --defaults\ncd ws\n# what `ng update` to v20 adds to angular.json under projects.ws.schematics:\n#   \"@schematics/angular:component\": { \"type\": \"component\" }\nng generate app-shell\nng build\n```\n\nGenerated `src/app/app-shell/app-shell.component.ts` contains `export class AppShellComponent {}`, but\n`src/app/app.config.server.ts` contains:\n\n```ts\nimport { AppShell } from './app-shell/app-shell';\n...\nprovideServerRendering(withRoutes(serverRoutes), withAppShell(AppShell))\n```\n\n**module --route** (2016 file name style):\n\n```sh\nng new ws --no-standalone --file-name-style-guide=2016 --defaults\ncd ws\nng generate module feature --route feature --module app\nng build\n```\n\nGenerated `src/app/feature/feature-routing.module.ts`:\n\n```ts\nimport { Feature } from './feature'; // the file is feature.component.ts\n```\n\n### Exception or Error\n\n```text\n# app-shell\n✘ [ERROR] TS2307: Cannot find module './app-shell/app-shell' or its corresponding type declarations. [plugin angular-compiler]\n✘ [ERROR] Could not resolve \"./app-shell/app-shell\"\n\n# module --route\n✘ [ERROR] Could not resolve \"./feature\"\n✘ [ERROR] TS2307: Cannot find module './feature' or its corresponding type declarations. [plugin angular-compiler]\n```\n\n### Your Environment\n\n```text\nAngular CLI       : 22.2.3\nNode.js           : 24.15.0\nPackage Manager   : npm 11.12.1\nOperating System  : darwin arm64\n@schematics/angular : 22.2.3\n```\n\n### Anything else relevant?\n\n- Affected since 20.0.0 (hard-coded names from 23fc8e1e17, \"generate components without a `.component`\n  extension/type\"). Same code on `21.2.x` and `22.2.x`.\n- Suggested fix: follow 661609e3e and pass `type: ''` (and `addTypeToClassName: false`, so the class name stays\n  `AppShell`/`Feature`) to the component schematic in `app-shell` and `module`, so the generated files always match\n  the references. Happy to send a PR.\n- The `module --route` case with `addTypeToClassName: false` also hits #\u003cissue for 01> (wrong NgModule declaration);\n  link the two once filed.","author":{"url":"https://github.com/MeAkib","@type":"Person","name":"MeAkib"},"datePublished":"2026-10-20T18:09:49Z","url":"https://github.com/angular/angular-cli/issues/34449"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3d81f569-53c5-e460-df78-2e0cb86f4709
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCD5C:3E418A:11BCA35:1759E17:6B01E456
html-safe-nonce1e6531181d7de938fbb9fd651a5373ad8d91f8f7a65e494d1b64b017660c2d93
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDVDOjNFNDE4QToxMUJDQTM1OjE3NTlFMTc6NkIwMUU0NTYiLCJ2aXNpdG9yX2lkIjoiMzkyMDU5NDkzMTU0NjE4NjgzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac893468e4a3657f809798b644ec9451940be7f897d07732e51bf2e1c67fed2a7f
hovercard-subject-tagissue:5946995910
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34449/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2ac3ed8de96adf99560b273e52b9332a85a23fdf3521cedc1b6bfe3089275fc8/angular/angular-cli/issues/34449
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2ac3ed8de96adf99560b273e52b9332a85a23fdf3521cedc1b6bfe3089275fc8/angular/angular-cli/issues/34449
og:image:altCommand generate 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 19.x (before the v20 file naming change) De...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMeAkib
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/34449#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F34449
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F34449
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/34449
Reloadhttps://github.com/angular/angular-cli/issues/34449
Reloadhttps://github.com/angular/angular-cli/issues/34449
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues198 (198)https://github.com/angular/angular-cli/issues
Pull requests23 (23)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
https://github.com/angular/angular-cli
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34449
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34449
#34450https://github.com/angular/angular-cli/pull/34450
#34472https://github.com/angular/angular-cli/pull/34472
ng generate app-shell and ng generate module --route produce broken imports when a component type is configuredhttps://github.com/angular/angular-cli/issues/34449#top
#34450https://github.com/angular/angular-cli/pull/34450
#34472https://github.com/angular/angular-cli/pull/34472
area: @schematics/angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40schematics%2Fangular%22
needsTriagehttps://github.com/angular/angular-cli/milestone/11
https://github.com/MeAkib
MeAkibhttps://github.com/MeAkib
on Oct 20, 2026https://github.com/angular/angular-cli/issues/34449#issue-5946995910
fdc6291https://github.com/angular/angular-cli/commit/fdc6291dda4903f418667d415b05367390cf829d
#26981https://github.com/angular/angular-cli/issues/26981
661609ehttps://github.com/angular/angular-cli/commit/661609e3e583198828baf236338db17b6222f4d8
23fc8e1https://github.com/angular/angular-cli/commit/23fc8e1e176f23442876b086bff52dd5f35abbc0
661609ehttps://github.com/angular/angular-cli/commit/661609e3e583198828baf236338db17b6222f4d8
angular-robothttps://github.com/apps/angular-robot
area: @schematics/angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40schematics%2Fangular%22
on Oct 20, 2026https://github.com/angular/angular-cli/issues/34449#event-33770914217
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular-cli/milestone/11
on Oct 20, 2026https://github.com/angular/angular-cli/issues/34449#event-33770917126
MeAkibhttps://github.com/MeAkib
on Oct 20, 2026https://github.com/angular/angular-cli/issues/34449#event-33771210215
fix(@schematics/angular): set explicit type for the app-shell componenthttps://github.com/MeAkib/angular-cli/commit/c7f3fceb4cd18009fc749a50238e90aed94f0de1
c7f3fcehttps://github.com/MeAkib/angular-cli/commit/c7f3fceb4cd18009fc749a50238e90aed94f0de1
fix(@schematics/angular): set explicit type for the `module --route` …https://github.com/MeAkib/angular-cli/commit/b7b643d5500f35ac3988369ff2130bf669ae688c
b7b643dhttps://github.com/MeAkib/angular-cli/commit/b7b643d5500f35ac3988369ff2130bf669ae688c
alan-agius4https://github.com/alan-agius4
on Oct 27, 2026https://github.com/angular/angular-cli/issues/34449#event-34342871978
fix(@schematics/angular): set explicit type for the `module --route` …https://github.com/MeAkib/angular-cli/commit/520f2f08e2aaa0ab3b197867553e7a14e14aaf84
https://docs.github.com/articles/closing-issues-via-commit-messages
520f2f0https://github.com/MeAkib/angular-cli/commit/520f2f08e2aaa0ab3b197867553e7a14e14aaf84
fix(@schematics/angular): set explicit type for the app-shell componenthttps://github.com/MeAkib/angular-cli/commit/aabcefef8013d77f71705f02b85b58c1c28ed0a5
https://docs.github.com/articles/closing-issues-via-commit-messages
aabcefehttps://github.com/MeAkib/angular-cli/commit/aabcefef8013d77f71705f02b85b58c1c28ed0a5
alan-agius4https://github.com/alan-agius4
completedhttps://github.com/angular/angular-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#34472https://github.com/angular/angular-cli/pull/34472
on Oct 27, 2026https://github.com/angular/angular-cli/issues/34449#event-34349344331
alan-agius4https://github.com/alan-agius4
on Oct 27, 2026https://github.com/angular/angular-cli/issues/34449#event-34349351863
fix(@schematics/angular): set explicit type for the `module --route` …https://github.com/angular/angular-cli/commit/9cba0da43f71bae7c6b01026843b2f312b25e6a5
https://docs.github.com/articles/closing-issues-via-commit-messages
9cba0dahttps://github.com/angular/angular-cli/commit/9cba0da43f71bae7c6b01026843b2f312b25e6a5
angular-robothttps://github.com/angular-robot
on Oct 27, 2026https://github.com/angular/angular-cli/issues/34449#event-34350416356
fix(@schematics/angular): set explicit type for the `module --route` …https://github.com/angular-robot/angular-cli/commit/02a067813bbaaf75c7a949d1da1b64a32ba101da
https://docs.github.com/articles/closing-issues-via-commit-messages
02a0678https://github.com/angular-robot/angular-cli/commit/02a067813bbaaf75c7a949d1da1b64a32ba101da
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular-cli/issues/34449
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34449
area: @schematics/angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40schematics%2Fangular%22
needsTriageNo due datehttps://github.com/angular/angular-cli/milestone/11
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.