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
My setup is a nx monorepo with an Expo apps/myapp and libs/hooks shared library.
During development there's no error. But when I compile the apk's final version, it crashes as soon it is opened because react-query complains that there are no client instantiated. It happens that there is, and only one. I've filed an issue on their repo but they said that the problem is during the bundling process.
Expected Behavior
react-query shouldn't be shipped twice nor react. (Accordingly to them, this is the probable cause).
I've fixed the problem isolating react-query imports into libs/hooks. More details on the original issue here: TanStack/query#7927
Does it means that nx is bundling wrongly? I can't use react-query into two different projects. Apparently it ships 2 versions of it or some kind of conflict...
essentially, what happens is that when build using eas, it does install at your project root and symlink the node_modules folder from project root to workspace root. i guess that is why it does not bundle react query package correctly.
what I did to fix it was:
in workspace root package.json, add field "workspaces" and include the your app, something like:
"workspaces": [
"apps/*",
"libs/*"
],
then project package.json, remove scripts eas-build-pre-install and eas-build-post-instal like:
Current Behavior
My setup is a nx monorepo with an Expo apps/myapp and libs/hooks shared library.
During development there's no error. But when I compile the apk's final version, it crashes as soon it is opened because react-query complains that there are no client instantiated. It happens that there is, and only one. I've filed an issue on their repo but they said that the problem is during the bundling process.
Expected Behavior
react-query shouldn't be shipped twice nor react. (Accordingly to them, this is the probable cause).
GitHub Repo
https://github.com/vendramini/nx-rq-test
Steps to Reproduce
nx run-android myapp
: it works, you will see both fetches on the screen (local one and another one from lib).nx build myapp --local --platform=android
: compile successfully, but crashes when opening it.Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
React Query issue: TanStack/query#7927
The text was updated successfully, but these errors were encountered: