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
Describe the bug
Hi there! I've been slowly working through implementing this library while moving from some TRPC endpoints. The queries work great but I ran in to an edge case with mutations that I thought I would bring up that's super easy to recreate hoping that there's a fix we can work together on?
Basically, I have a NextJS app that uses moduleResolution: "Bundler"https://www.typescriptlang.org/tsconfig#moduleResolution as it is recommended for apps that use things like webpack or vite...when I try to use useDeleteMutation, I lose typesafety in the props. When inspecting the library's index.d.ts for useDeleteMutation, it marks the import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types'; as "unresolved".
If I take the example repo and modify to moduleResolution: "Bundler" and restart the TS Language Server...
I see the following:
If I switch back moduleResolution: node then the typesafety works!
I'm wondering if we can provide some compatibility for this moduleResolution?
Describe the bug
Hi there! I've been slowly working through implementing this library while moving from some TRPC endpoints. The queries work great but I ran in to an edge case with mutations that I thought I would bring up that's super easy to recreate hoping that there's a fix we can work together on?
Basically, I have a NextJS app that uses
moduleResolution: "Bundler"
https://www.typescriptlang.org/tsconfig#moduleResolution as it is recommended for apps that use things like webpack or vite...when I try to useuseDeleteMutation
, I lose typesafety in the props. When inspecting the library's index.d.ts foruseDeleteMutation
, it marks theimport * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
as "unresolved".If I take the example repo and modify to
moduleResolution: "Bundler"
and restart the TS Language Server...I see the following:
If I switch back
moduleResolution: node
then the typesafety works!I'm wondering if we can provide some compatibility for this
moduleResolution
?To Reproduce
examples/react-query/tsconfig.json
useDeleteMutation
in theuse-query.tsx
and try and view the propertiesHere's a forked repo that recreate's the issue: https://github.com/uncvrd/supabase-cache-helpers
Here's the git diff for reference: uncvrd@06c3976
Expected behavior
I expect to have typesafety when using
moduleResolution: Bundler
in the tsconfig.jsonPossibly more relevant information here? TanStack/query#6318
Happy to help debug, thanks so much for working on this project!
The text was updated successfully, but these errors were encountered: