Skip to content
Source
Sign inSign up
TanStack/query

`react-query/devtools`'s `module` entry points to a CJS file #3513

Send to my agent
Closedhaoqunjiang(GitHub profile, opens in a new tab) opened this issue 2 comments

Describe the bug

Essentially reposting https://github.com/tannerlinsley/react-query/issues/3505 here. Though Vite reverted that change, I believe it is a bug in react-query.

The module field of react-query/devtools points to a CJS file that reexports from a subfolder containing nothing but a package.json, and it expects the reexport resolves to the module 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-definitions

Your minimal, reproducible example

https://github.com/akharkhonov/vite-react-query

Steps to reproduce

  1. Install dependencies yarn --frozen-lockfile
  2. Run dev mode yarn dev
  3. Open devttools and see errors

Expected behavior

No errors.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: Version 100.0.4896.88 (Official Build) (arm64)

react-query version

3.34.19

TypeScript version

4.6.3

Additional context

No response

  1. I would be very grateful if you could help with fixing this. My knowledge about modules and bundling is quite limited to be honest

  2. TkDodo added labelsbug

  3. TkDodo added labelspackage: react-query-devtools

  4. :tada: This issue has been resolved in version 4.0.0-beta.6 :tada:

    The release is available on:

    Your semantic-release bot :package::rocket:

  5. tannerlinsley added labelsreleased on @beta

  6. TkDodo closed this

Sign in to join this conversation.