Skip to content

fix(angular): keep ng generate working with angular-toolkit 13 - #1887

Merged
ShaneK merged 1 commit into
mainfrom
fix/angular-toolkit-13
Aug 19, 2026
Merged

fix(angular): keep ng generate working with angular-toolkit 13#1887
ShaneK merged 1 commit into
mainfrom
fix/angular-toolkit-13

Conversation

@ShaneK

@ShaneK ShaneK commented Aug 19, 2026

Copy link
Copy Markdown
Member

@ionic/angular-toolkit@13.0.0 is out. Both Angular starters need it, and the NgModule starter needs one extra change to survive a default that moved.

Both Angular starters targeted @ionic/angular ^9.0.0 while pinning
@ionic/angular-toolkit ^12.3.0, and ^12.3.0 cannot resolve to 13.0.0. Toolkit 12
generates Ionic 8 import paths, so `ng generate page` in a freshly started v9 app
produced code that does not compile: it imports IonicModule from '@ionic/angular'
and standalone components from '@ionic/angular/standalone', neither of which is
correct in Ionic 9. Toolkit 12 also declares no peerDependencies, so npm installed
it against Angular 22 without a warning.

Toolkit 13 additionally flips the `standalone` default for the page and component
schematics from false to true, which the NgModule starter was relying on. Left
alone, `ng generate page` there takes the standalone path, looks for a *.routes.ts
that an NgModule starter does not have, and fails with "Could not find your routes
file". Both starters now state `standalone` explicitly rather than inheriting a
default that can move again: false for angular, true for angular-standalone.

Verified by building both blank starters with --current, installing, and running
the schematics against the released toolkit 13.0.0:

- angular: emits an NgModule page and registers it in app-routing.module.ts
- angular-standalone: emits a standalone page importing from the '@ionic/angular'
  root and registers it in app.routes.ts
- both: `npm run build` succeeds and 4/4 tests pass, generated specs included

Both starters are zoneless, so the toolkit 13 spec template fix matters here too:
toolkit 12 generated component specs using waitForAsync, which needs zone.js.
@ShaneK
ShaneK requested a review from a team as a code owner August 19, 2026 21:22
@ShaneK
ShaneK requested review from brandyscarney and removed request for a team August 19, 2026 21:22

@gnbm gnbm 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.

LGTM

@ShaneK
ShaneK merged commit 557f7c4 into main Aug 19, 2026
30 checks passed
@ShaneK
ShaneK deleted the fix/angular-toolkit-13 branch August 19, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants