Skip to content

fix(angular): migration schematic no longer aborts on file subpath imports - #12033

Open
imaksp wants to merge 1 commit into
TanStack:angular-adapter-prefrom
imaksp:fix/angular-migration-file-subpath
Open

imaksp wants to merge 1 commit into
TanStack:angular-adapter-prefrom
imaksp:fix/angular-migration-file-subpath

Conversation

@imaksp

@imaksp imaksp commented Oct 15, 2026 •

Copy link
Copy Markdown

🎯 Changes

Fixes #12032.

migrate-from-experimental aborts before migrating anything when a project source imports a package subpath that names a file, for example import { sha3_256 } from '@noble/hashes/sha3.js':

Path "/node_modules/@noble/hashes/sha3.js" is a file.

TypeScript's module resolution calls the compiler host's directoryExists with candidate paths, and some of them are files. The host in configuredSources() passed every path to tree.getDir(), which throws PathIsFileException for a file. directoryExists now returns false when the path is a file (tree.exists() is true only for files).

The new regression test in migrate-from-experimental.test.ts builds a workspace whose source imports a file subpath of a package with an exports map. It fails without the fix, with the error above, and passes with it. Repro: https://github.com/imaksp/tanstack-angular-query-migrate-schematic-repro

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
    • I didn't run the full test:pr. In packages/angular-query I ran the schematic suite (vitest.schematics.config.ts, 71/71), test:eslint and test:types:tscurrent.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

🤖 Generated with Claude Code

…ports

TypeScript probes `directoryExists` with paths that are files during module
resolution; `Tree.getDir()` throws on those. Report them as non-directories.

Fixes TanStack#12032

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: TanStack/query/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bd9b8715-70ff-4641-be46-da0982423f4d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 1e3270d

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 4m 47s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 9s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-16 02:04:04 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 16, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query

npm i https://pkg.pr.new/TanStack/query/@tanstack/angular-query@12033

@tanstack/angular-query-devtools

npm i https://pkg.pr.new/TanStack/query/@tanstack/angular-query-devtools@12033

@tanstack/angular-query-persist-client

npm i https://pkg.pr.new/TanStack/query/@tanstack/angular-query-persist-client@12033

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/TanStack/query/@tanstack/eslint-plugin-query@12033

@tanstack/lit-query

npm i https://pkg.pr.new/TanStack/query/@tanstack/lit-query@12033

@tanstack/preact-query

npm i https://pkg.pr.new/TanStack/query/@tanstack/preact-query@12033

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/TanStack/query/@tanstack/preact-query-devtools@12033

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/TanStack/query/@tanstack/preact-query-persist-client@12033

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/TanStack/query/@tanstack/query-async-storage-persister@12033

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/TanStack/query/@tanstack/query-broadcast-client-experimental@12033

@tanstack/query-core

npm i https://pkg.pr.new/TanStack/query/@tanstack/query-core@12033

@tanstack/query-devtools

npm i https://pkg.pr.new/TanStack/query/@tanstack/query-devtools@12033

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/TanStack/query/@tanstack/query-persist-client-core@12033

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/TanStack/query/@tanstack/query-sync-storage-persister@12033

@tanstack/react-query

npm i https://pkg.pr.new/TanStack/query/@tanstack/react-query@12033

@tanstack/react-query-devtools

npm i https://pkg.pr.new/TanStack/query/@tanstack/react-query-devtools@12033

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/TanStack/query/@tanstack/react-query-next-experimental@12033

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/TanStack/query/@tanstack/react-query-persist-client@12033

@tanstack/solid-query

npm i https://pkg.pr.new/TanStack/query/@tanstack/solid-query@12033

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/TanStack/query/@tanstack/solid-query-devtools@12033

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/TanStack/query/@tanstack/solid-query-persist-client@12033

@tanstack/svelte-query

npm i https://pkg.pr.new/TanStack/query/@tanstack/svelte-query@12033

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/TanStack/query/@tanstack/svelte-query-devtools@12033

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/TanStack/query/@tanstack/svelte-query-persist-client@12033

@tanstack/vue-query

npm i https://pkg.pr.new/TanStack/query/@tanstack/vue-query@12033

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/TanStack/query/@tanstack/vue-query-devtools@12033

commit: 1e3270d

@benjavicente benjavicente self-assigned this Oct 16, 2026

This branch has not been deployed

No deployments
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