Skip to content

fix(@schematics/angular): set explicit type for the app-shell component - #34450

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/app-shell-component-type
Open

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/app-shell-component-type

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

ng generate app-shell adds an AppShell import from ./app-shell/app-shell, but the component it generates inherits the workspace type option. In workspaces that set "@schematics/angular:component": { "type": "component" }, such as those updated to v20, the component was generated as app-shell.component.ts and the import failed to resolve.

Pass an empty type, as the library schematic does (661609e).

Fixes #34449

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Angular app-shell schematic to explicitly set the component type option to an empty string (type: ''). This prevents the generated app-shell component from inheriting a custom component type from the workspace defaults, which would otherwise alter the file and class names and break the expected AppShell import. Additionally, a unit test has been added to verify this behavior by emulating workspace defaults. There are no review comments to address, and the changes look solid.

`ng generate app-shell` adds an `AppShell` import from `./app-shell/app-shell`, but the component it
generates inherits the workspace `type` option. In workspaces that set
`"@schematics/angular:component": { "type": "component" }`, such as those updated to v20, the
component was generated as `app-shell.component.ts` and the import failed to resolve.

Pass an empty `type`, as the library schematic does (661609e).

Refs angular#34449
@MeAkib
MeAkib force-pushed the fix/app-shell-component-type branch from 7ece3b8 to c7f3fce Compare October 20, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng generate app-shell and ng generate module --route produce broken imports when a component type is configured

1 participant