-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Missing dependency on react-dom leads to runtime errors when using yarn berry #3534
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
Comments
hmm, I am seeing that we have Yarn also respects the |
we only use we call this here: and we have two files:
I'm not sure if the native one is picked up for react-native automatically, maybe @arnaudbzn knows this? But it seems like you need either |
I have a sandbox environment where I don't have any access to the DOM, and react-dom doesn't work. Is there any workaround to use react-query without react-dom? |
@WPaczula does it not work to call |
If missing, then strict package managers like pnpm will not link this react-dom in, causing react-query to fail at runtime cause it can't load react-dom. Fixes TanStack#3534
Describe the bug
When using react-query in a project using yarn berry (3+), in combination with workspace, then dependencies are no longer shared across the project and instead only direct dependencies of each library are visible to it.
As a result, using react-query from a next.js project and client side rendering fails as it is unable to import react-dom, which does not appear as a dependency, or a peer dependency, in react query.
It is possible to work around this by making react and react-dom dependencies of the top level project in a yarn workspace.
Your minimal, reproducible example
N/A
Steps to reproduce
Expected behavior
React-dom is resolved as dependency of react-query, or alternatively, a react-dom specific version of / addon to react-query is required in a react-dom environment.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
react-query version
3.35.0
TypeScript version
4.6.3
Additional context
No response
The text was updated successfully, but these errors were encountered: