Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TS moduleResolution: node16 in svelte-query #7463

Open
giacomoran opened this issue May 20, 2024 · 0 comments
Open

Support TS moduleResolution: node16 in svelte-query #7463

giacomoran opened this issue May 20, 2024 · 0 comments

Comments

@giacomoran
Copy link

giacomoran commented May 20, 2024

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/[email protected]

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

codesandbox

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.

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

No branches or pull requests

1 participant