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): require only exported devkit paths from the shipped schematics by armando-navarro · Pull Request #3793 · angular/angularfire

Conversation

@armando-navarro

@armando-navarro armando-navarro commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Fixes #3789

The shipped schematics now require @angular-devkit/schematics/tasks, which every devkit version accepts, instead of @angular-devkit/schematics/tasks/index.js, which the exports map in devkit 22.3 rejects.

Changes

All in compileSchematics in tools/build.ts.

  • An esbuild alias rewrites @angular-devkit/schematics/tasks/index.js to @angular-devkit/schematics/tasks in the bundles.
  • The two source files keep the index.js spelling, because the ESM spec run cannot import the bare tasks folder from the repo's devkit 21, which has no exports map.
  • The build now fails if a bundle requires a subpath of an external package that is not listed in exportedSubpaths, and names the files that import it. The list holds @angular-devkit/schematics/tasks, @schematics/angular/utility and rxjs/operators, each of which is in its package's exports map.
  • The external package list moves into a named externalPackages constant, which the check reads.

Behavior to know

When the repo's own devkit reaches 22.3 or later, the two source imports can switch to @angular-devkit/schematics/tasks and the alias can go.

Verification

  • With the package built from this branch, the setup, add, deploy builder, v7 migration and v21 migration bundles all load with @angular-devkit/schematics 21.2.25 and 22.3.0-next.0. With the current canary, setup/index.js, deploy/builder.js and update/v21/index.js fail under 22.3.0-next.0.
  • Removing the alias fails the build with:
    The schematics require package paths that exportedSubpaths does not list:
      @angular-devkit/schematics/tasks/index.js, imported by src/schematics/utils.ts, src/schematics/update/v21/index.ts
    
  • npm run test:node: 342 specs, 0 failures.

Sorry, something went wrong.

Uh oh!

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

All reactions
@armando-navarro
fix(schematics): require only exported devkit paths from the shipped …
d88d4d6
…schematics

@angular-devkit/schematics 22.3 adds an exports map that allows ./tasks
but not ./tasks/index.js. The shipped setup, deploy builder and v21
migration bundles required tasks/index.js, so `ng update` crashed after
installing whenever it ran a 22.3 CLI, and the v21 migration never ran.

The source keeps the index.js spelling, which the ESM spec run needs
while the repo's devkit 21 has no exports map. An esbuild alias rewrites
it in the bundles, and the build now fails when a bundle requires a
package subpath that is not in exportedSubpaths, naming the importers.

typescript stays external so the v21 migration uses the compiler from
the user's workspace at ng update time, rather than adding about 3.5 MB
to the package.
@armando-navarro
armando-navarro requested a review from tyler-reitz October 8, 2026 00:09
@armando-navarro armando-navarro added bump: patch Size of the change: a fix or docs change that reaches users comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen. labels Oct 8, 2026
tyler-reitz
tyler-reitz approved these changes Oct 8, 2026
View reviewed changes

@tyler-reitz tyler-reitz left a comment

Copy link
Copy Markdown
Collaborator

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.

LGTM. Two notes, neither blocking.

Verified the fix by loading the built bundles rather than reading the diff. All six load against @angular-devkit/schematics 21.2.25 and 22.3.0-next.0; the published canary fails under 22.3.0-next.0 on setup/index.js, deploy/builder.js and update/v21/index.js with ERR_PACKAGE_PATH_NOT_EXPORTED, the three files you name. Deleting the alias and rebuilding does produce the guard error, so the new check can actually fail.

One thing to fix if you agree: the move into externalPackages drops the comment explaining why typescript is external (tools/build.ts:407-408 on main, the one about resolving it at ng-update time instead of bundling ~3.5MB). Nothing fails if someone later removes that entry, the package just gets bigger quietly, so it is worth moving the comment along with the entry.

Observation only: exportedSubpaths is never checked against a real exports map, though the comment says each entry is in one. rxjs@next (9.0.0-beta.0) has no ./operators export, so that entry is already stale for the newest rxjs. Harmless while the peer is ~7.8.0, but the build cannot notice if an entry goes bad.

Sorry, something went wrong.

Uh oh!

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

All reactions
@armando-navarro armando-navarro added this to the 21.0.0-rc.2 milestone Oct 8, 2026
@armando-navarro

armando-navarro commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

I'm leaving the typescript comment out. On exportedSubpaths, I agree nothing checks it against the real exports maps. That matters only once AngularFire allows rxjs 9, so I'm leaving it for now.

All reactions

Sorry, something went wrong.

Uh oh!

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

@armando-navarro
Merge branch 'main' into a68-schematics-tasks-import
277ddfd
@armando-navarro
armando-navarro merged commit d95316b into angular:main Oct 9, 2026
24 checks passed

Uh oh!

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

@tyler-reitz tyler-reitz mentioned this pull request Oct 9, 2026
Backport ten fixes to 20.1.x for 20.1.1 #3798
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tyler-reitz tyler-reitz tyler-reitz approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

bump: patch Size of the change: a fix or docs change that reaches users comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen.

Projects

None yet

Milestone

21.0.0-rc.2

Development

Successfully merging this pull request may close these issues.

ng update @angular/fire stops before the v21 migration when it runs Angular CLI 22.3

Uh oh!

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

2 participants

@armando-navarro @tyler-reitz
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.