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
If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.
Describe the bug
When attempting to import react-query/devtools, I get this error. Seems like some issue in module resolution. It worked without errors on beta version 35, if I recall correctly
(node:11664) UnhandledPromiseRejectionWarning: Error: Failed to resolve entry for package "\Projects\vite-react-query\node_modules\.pnpm\react-query@3.6.0_react-dom@17.0.1+react@17.0.1\node_modules\react-query\devtools". The package may have incorrect main/module/exports specified in its package.json.
at resolvePackageEntry (\Projects\vite-react-query\node_modules\.pnpm\vite@2.0.0-beta.44\node_modules\vite\dist\node\chunks\dep-3174cbb5.js:39897:15)
at tryResolveFile (\Projects\vite-react-query\node_modules\.pnpm\vite@2.0.0-beta.44\node_modules\vite\dist\node\chunks\dep-3174cbb5.js:39701:24)
at tryFsResolve (\Projects\vite-react-query\node_modules\.pnpm\vite@2.0.0-beta.44\node_modules\vite\dist\node\chunks\dep-3174cbb5.js:39684:16)
at resolveDeepImport (\Projects\vite-react-query\node_modules\.pnpm\vite@2.0.0-beta.44\node_modules\vite\dist\node\chunks\dep-3174cbb5.js:39932:26)
at tryNodeResolve (\Projects\vite-react-query\node_modules\.pnpm\vite@2.0.0-beta.44\node_modules\vite\dist\node\chunks\dep-3174cbb5.js:39752:11)
at optimizeDeps (\Projects\vite-react-query\node_modules\.pnpm\vite@2.0.0-beta.44\node_modules\vite\dist\node\chunks\dep-3174cbb5.js:71071:30)
at async runOptimize (\Projects\vite-react-query\node_modules\.pnpm\vite@2.0.0-beta.44\node_modules\vite\dist\node\chunks\dep-3174cbb5.js:71577:13)
at async Server.httpServer.listen (\Projects\vite-react-query\node_modules\.pnpm\vite@2.0.0-beta.44\node_modules\vite\dist\node\chunks\dep-3174cbb5.js:71590:13)
Note react-query/devtools has no default export so your usage is wrong. It should be import { ReactQueryDevtools } from 'react-query/devtools' instead of using the default import.
After that there is still a runtime error - which I don't think is Vite related.
First off, thanks for the quick fix, and for all your awesome work on this 👏
Note react-query/devtools has no default export so your usage is wrong. It should be import { ReactQueryDevtools } from 'react-query/devtools' instead of using the default import.
You're right, and that's how I normally would've done it. But previous Vite versions would transform the module into a default export, which is why I wrote it the way I did. But that also seems to be resolved now 💯
Describe the bug
When attempting to import
react-query/devtools
, I get this error. Seems like some issue in module resolution. It worked without errors on beta version 35, if I recall correctlyReproduction
https://github.com/itsMapleLeaf/vite-react-query
System Info
vite
version: 2.0.0-beta.44The text was updated successfully, but these errors were encountered: