You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'.
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.
The text was updated successfully, but these errors were encountered:
Describe the bug
In TS,
@tanstack/svelte-query
imports are broken undermoduleResolution: nodenext
(currently equivalent tomoduleResolution: node16
). See https://arethetypeswrong.github.io/?p=@tanstack/[email protected]This happens because imports/exports in
dist
are missing the file extensions, e.g.export { createQuery } from './createQuery'
instead ofexport { createQuery } from './createQuery.js'
.Your minimal, reproducible example
codesandbox
Steps to reproduce
I forked the "Simple" Svelte example.
Hover
type InspectMe = typeof createQuery
insrc/test.ts
, the type appears asany
undermoduleResolution: 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 strictestmoduleResolution
option, it ensures that both node and browsers understand our modules.The text was updated successfully, but these errors were encountered: