From 520f2f08e2aaa0ab3b197867553e7a14e14aaf84 Mon Sep 17 00:00:00 2001 From: MeAkib Date: Wed, 21 Oct 2026 16:49:23 +0600 Subject: [PATCH] fix(@schematics/angular): set explicit type for the `module --route` 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 #34449 --- packages/schematics/angular/module/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/schematics/angular/module/index.ts b/packages/schematics/angular/module/index.ts index adf0474a08a3..ce966eb0f778 100644 --- a/packages/schematics/angular/module/index.ts +++ b/packages/schematics/angular/module/index.ts @@ -183,6 +183,10 @@ const moduleSchematic: RuleFactory = createProjectSchematic( path: options.path, project: options.project, standalone: false, + // The route templates reference the component by its default file and class name, so the + // component must not inherit a `type` or `exportDefault` from the workspace. + type: '', + exportDefault: false, }; return chain([