-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
react-query v4: useSyncExternalStore error with Create React App #3637
Comments
Same issue here and I'm using windows |
@hirbod @sachinraja can you maybe also have a look here? I'm not sure if we're doing some wrong in our imports / exports, or if this is CRA related? We have some examples that run on CRA 3.x and they are fine 🤔 |
I am afraid that I am not the best person to answer this. All my knowledge goes down to RN |
The error is correct. We need to change import pkg from 'use-sync-external-store/shim/index.js'
export const useSyncExternalStore = pkg.useSyncExternalStore This is due to esm/cjs interop. The error isn't in |
Ah yeah, I remember seeing this fix in another repo, I think it was reanimated or react-native-gesture-handler. |
thx, I'll make a PR. One more question: is the code for
|
The metro bundler only picks the cjs path for this package but yeah it should probably also be changed. |
🎉 This issue has been resolved in version 4.0.0-beta.17 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug
Using
[email protected]
(a.k.a. Create React App) does not work with[email protected]
. The following is the error that occurs when running the development server:Your minimal, reproducible example
https://github.com/tmm/react-query-debug
Steps to reproduce
npm i
npm start
Expected behavior
I expected to not get an
useSyncExternalStore
errorHow often does this bug happen?
Every time
Screenshots or Videos
Platform
react-query version
4.0.0-beta.X
TypeScript version
No response
Additional context
Reporting based on this comment by TkDodo for wevm/wagmi#398
The text was updated successfully, but these errors were encountered: