-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Describe the bug
In TS, @tanstack/svelte-query imports are broken under moduleResolution: nodenext (currently equivalent to moduleResolution: node16). See https://arethetypeswrong.github.io/?p=@tanstack/svelte-query@5.37.1
This happens because imports/exports in dist are missing the file extensions, e.g. export { createQuery } from './createQuery' instead of export { createQuery } from './createQuery.js'.
Your minimal, reproducible example
Steps to reproduce
I forked the "Simple" Svelte example.
Hover type InspectMe = typeof createQuery in src/test.ts, the type appears as any under moduleResolution: nodenext.
Expected behavior
InspectMe type should be resolved correctly.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
NA
Tanstack Query adapter
None
TanStack Query version
5.37.1
TypeScript version
5.3.3
Additional context
We use moduleResolution: nodenext for our SvelteKit project because we have shared modules that are executed with Node.js. moduleResolution: nodenext is the strictest moduleResolution option, it ensures that both node and browsers understand our modules.