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 — fix(@schematics/angular): set explicit type for the `module --route` component by MeAkib · Pull Request #34472 · angular/angular-cli

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

ng generate module --route generates a component and references it from the routing module template by its default file and class name (./foo, Foo). The component inherited the workspace type option, so in workspaces that set it (e.g. after updating to v20) the component was generated as foo.component.ts and the routing module import failed to resolve.

Pass an empty type, as the library and app-shell schematics do.

Fixes #34449

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@angular-robot angular-robot Bot added the area: @schematics/angular label Oct 22, 2026
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Oct 22, 2026
View reviewed changes

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

Copy link
Copy Markdown

There was a problem hiding this comment.

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 ensures that when generating a module, the nested component does not inherit a type from the workspace defaults, preventing broken route templates. A corresponding unit test has been added. A review comment suggests using the public engine property instead of accessing the private _engineHost property in the test to register the options transform, which improves type safety and avoids relying on private implementation details.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/schematics/angular/module/index_spec.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@alan-agius4
alan-agius4 self-requested a review October 22, 2026 11:14
@alan-agius4 alan-agius4 added target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release and removed target: minor This PR is targeted for the next minor release labels Oct 22, 2026
thekhegay
thekhegay reviewed Oct 23, 2026
View reviewed changes
Comment thread packages/schematics/angular/module/index.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@MeAkib
MeAkib force-pushed the fix/module-route-component-type branch from 6ef0386 to 15f0372 Compare October 23, 2026 17:19
alan-agius4
alan-agius4 approved these changes Oct 27, 2026
View reviewed changes
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 27, 2026
@MeAkib @alan-agius4
fix(@schematics/angular): set explicit type for the module --route …
520f2f0
…component

`ng generate module --route` generates a component and references it from the routing module
template by its default file and class name (`./foo`, `Foo`). The component inherited the
workspace `type` option, so in workspaces that set it (e.g. after updating to v20) the component
was generated as `foo.component.ts` and the routing module import failed to resolve.

Pass an empty `type`, as the library and app-shell schematics do.

Fixes angular#34449
@alan-agius4
alan-agius4 force-pushed the fix/module-route-component-type branch from 15f0372 to 520f2f0 Compare October 27, 2026 08:00
@alan-agius4
alan-agius4 merged commit 02a0678 into angular:main Oct 27, 2026
39 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@alan-agius4

alan-agius4 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

  • main: 02a0678
  • 22.2.x: 9cba0da
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MeAkib
MeAkib deleted the fix/module-route-component-type branch October 27, 2026 15:05
This was referenced Nov 11, 2026
ng generate application produces a missing stylesheet when a workspace component type is configured #34684
Open
fix(@schematics/angular): set explicit type for the application root component #34685
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@alan-agius4 alan-agius4 alan-agius4 approved these changes
+2 more reviewers
@thekhegay thekhegay thekhegay left review comments
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: patch This PR is targeted for the next patch release

Projects

None yet

Milestone

No milestone

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

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@MeAkib @alan-agius4 @thekhegay
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.