angular-query: migrate-from-experimental schematic crashes with 'Path ... is a file' on a .js subpath import
Les mainteneurs répondent en général sous 1 jour
@benjavicente y travaille déjà.
Depuis le 16/10/2026.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 45/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- angular, typescript
- Domaine
- devtools
Piste de recherche
The crash comes from the compiler host built in configuredSources() in packages/angular-query/schematics/migrate-from-experimental/workspace.ts, where directoryExists calls tree.getDir(path) on paths that can be files. Read that host and how the devkit Tree reports files versus directories, then reproduce with the linked repro and a source importing a .js subpath such as @noble/hashes/sha3.js. Done means the dry run lists the expected UPDATE entries instead of throwing, with a regression test in the schematic's test suite. The reporter says they plan to open the PR themselves, so confirm with them before starting.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
The migrate-from-experimental schematic in @tanstack/[email protected] aborts before migrating anything when a project source imports a package subpath that names a file, such as import { sha3_256 } from '@noble/hashes/sha3.js':
Path "/node_modules/@noble/hashes/sha3.js" is a file.
The cause is the compiler host built in configuredSources() (packages/angular-query/schematics/migrate-from-experimental/workspace.ts). Its directoryExists calls tree.getDir(path) directly. TypeScript's module resolution probes candidate paths with directoryExists, and some of them are files. The devkit Tree.getDir() then throws PathIsFileException rather than reporting that no directory exists.
Your minimal, reproducible example
https://github.com/imaksp/tanstack-angular-query-migrate-schematic-repro
Steps to reproduce
- Clone the repro and run
pnpm install. - Run
pnpm exec ng generate @tanstack/angular-query:migrate-from-experimental --dry-run. - See
Path "/node_modules/@noble/hashes/sha3.js" is a file.
It also reproduces with an npm-style flat layout (pnpm install --config.node-linker=hoisted). Removing the @noble/hashes/sha3.js import makes the dry run succeed.
Expected behavior
The schematic migrates the workspace: the dry run lists UPDATE src/main.ts and UPDATE package.json. Instead it throws, and none of the project's files are migrated. In a real workspace, every file is skipped as soon as one source imports such a subpath.
How often does this bug happen?
Every time
Platform
- OS: macOS 26
- Node: 26.8.2
- pnpm: 12.9.1
- Angular CLI: 22.2.1
Tanstack Query adapter
angular-query
TanStack Query version
5.0.0-rc.3
TypeScript version
6.0.3
Additional context
Making directoryExists return false for a path that is a file fixes it. tree.exists() is true only for files:
host.directoryExists = (path) => {
if (tree.exists(path)) return false
const directory = tree.getDir(path)
return directory.subfiles.length > 0 || directory.subdirs.length > 0
}
With that change the repro's dry run succeeds. I'll open a PR with the fix and a regression test.
- Langage dominant
- TypeScript
- Étoiles
- 50.5k
- Forks
- 4.2k
- Merge moyen
- 9 h 34 min
- PR mergées (30 j)
- 603
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TanStack/query
-
QueryClient.isFetching and useIsFetching accept a fetchStatus filter and ignore itPeut-être pris @Apu-Emdad l’a pris il y a 11 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Peut-être à nouveau libre @LeonxLJX l’a pris il y a 52 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
TanStack/query#11358 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
angular-query-experimental: `import * as ng` in pending-tasks-compat pulls all of @angular/core into the initial bundlePeut-être pris @benjavicente l’a pris aujourd’hui. Ouvertepackage: angular-query
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
TanStack/query#12319 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Structural sharing drops a `__proto__` key from query data and changes the object's prototypePeut-être pris @Gourav224 l’a pris il y a 2 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
useBaseQuery fetches the old query key when an <Activity> tree is revealedPeut-être pris @lazerg l’a pris il y a 5 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TanStack/query
Issues similaires
-
Manager flashes an empty "errorOccurred" dialog while redirecting a logged-out user to loginOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
openremote/openremote#3487 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
coollabsio/jean#867 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ehmpathy/rhachet-roles-bhuild#616 ·
Les mainteneurs répondent en général sous 1 jour
-
📘 Docs supabase/cli
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
Les mainteneurs répondent en général sous 1 jour
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)Ouvertearea/core kind/bug priority/p2 status/bot-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
google-gemini/gemini-cli#29955 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour