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
Ok I'm sure its not impossible but it feels that way.
I've spent 2 full weeks trying to properly configure a monorepo with pnpm, turbo, nextjs, react native and jest. I can get everything working perfectly but the second react-native (with expo) enters the repo everything falls apart.
I can run the expo app from the monorepo and import packages from the ui folder but testing is a whole other story. react-native needs the node-linker=hoisted flag set which usually makes it hard for jest in the mobile app package to find a needed dependency.
Also if I import a custom react-native component from the ui folder, import it into the mobile app and try to test it I usually get an error Invariant Violation: __fbBatchedBridgeConfig is not set, cannot invoke native modules like this.
I think I've gone through every monorepo resource on the internet that mentions react-native and/or jest and still can't configure it properly.
I did find this helpful boilerplate but it uses yarn workspaces which I believe handles node_modules differently than pnpm.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Ok I'm sure its not impossible but it feels that way.
I've spent 2 full weeks trying to properly configure a monorepo with pnpm, turbo, nextjs, react native and jest. I can get everything working perfectly but the second react-native (with expo) enters the repo everything falls apart.
I can run the expo app from the monorepo and import packages from the
uifolder but testing is a whole other story.react-nativeneeds thenode-linker=hoistedflag set which usually makes it hard for jest in the mobile app package to find a needed dependency.Also if I import a custom react-native component from the
uifolder, import it into themobileapp and try to test it I usually get an errorInvariant Violation: __fbBatchedBridgeConfig is not set, cannot invoke native moduleslike this.I think I've gone through every monorepo resource on the internet that mentions react-native and/or jest and still can't configure it properly.
I did find this helpful boilerplate but it uses yarn workspaces which I believe handles
node_modulesdifferently than pnpm.https://github.com/Enricopv/turbo-boilerplate
If anyone has any idea how to do this please point me in the right direction.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions