react-query/devtools
's module
entry points to a CJS file
#3513
Labels
react-query/devtools
's module
entry points to a CJS file
#3513
Describe the bug
Essentially reposting #3505 here.
Though Vite reverted that change, I believe it is a bug in
react-query
.The
module
field ofreact-query/devtools
points to a CJS file that reexports from a subfolder containing nothing but apackage.json
, and it expects the reexport resolves to themodule
field of that subfolder.It violates the convention that
module
field should contain ESM syntax.To provide different exports for different environments in the ES module system, maybe the
exports
field can help here: https://nodejs.org/api/packages.html#community-conditions-definitionsYour minimal, reproducible example
https://github.com/akharkhonov/vite-react-query
Steps to reproduce
yarn --frozen-lockfile
yarn dev
Expected behavior
No errors.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
react-query version
3.34.19
TypeScript version
4.6.3
Additional context
No response
The text was updated successfully, but these errors were encountered: