angular-query: migrate-from-experimental schematic crashes with 'Path ... is a file' on a .js subpath import
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, typescript
- Bereich
- devtools
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 50.4k
- Forks
- 4.2k
- Ø Merge
- 8 Std. 51 Min.
- Gemergte PRs (30 T.)
- 432
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/query
-
QueryClient.isFetching and useIsFetching accept a fetchStatus filter and ignore itEvtl. vergeben @Apu-Emdad hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Evtl. wieder frei @LeonxLJX hat das vor 42 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
TanStack/query#11358 · 2 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
solid-query: switching the queryClient accessor strands the new client's cache (subscription stays on the old observer)Evtl. vergeben @MaNaN1803 hat das vor 85 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
TanStack/query#11106 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
solid-query 6.0.0-rc.5: onCacheEvent throws NotReadyError during a Solid 2 (rc.14+) transition landingEvtl. vergeben @UzumakiODZ hat das vor 1 Tag übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 28/100
TanStack/query#12031 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Explicit gcTime schedules a GC timer during SSR, retaining the whole render in memoryEvtl. vergeben @AdzerKI hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 70/100
lingdojo/kana-dojo#32590 · 1 Kommentar · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
bastani-inc/atomic#3703 ·
Maintainer antworten meist innerhalb von 1 Tag
-
backend bug difficulty: medium priority: medium reliability
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
trustflow-protocol/trustflow-backend#730 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
firecrawl/firecrawl-mcp-server#548 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 1 Tag