turbo: `with-react-native-web` example doesn't work
What version of Turborepo are you using?
latest
What package manager are you using / does the bug impact?
Yarn v1
What operating system are you using?
Mac
Describe the Bug
The with-react-native-web example doesn’t work.
Expected Behavior
The example should work in order for developers to learn and explore how things are wired up.
Furthermore, the example is using the exact same React v17.x version in both Next.js and Expo apps. In a real-world scenario, React versions between Next.js and Expo rarely match between them. Developers could struggle a lot just because of this.
Please, provide an up-to-date with-react-native-web example, keep Next.js and Expo running with the latest compatible dependency versions, and highlight and make developers aware of the solution to fix React incompatibility issues when there is more than one React version (which is pretty common when using Next.js and Expo in a monorepo setup).
To Reproduce
npx degit vercel/turborepo/examples/with-react-native-web with-react-native-webcd with-react-native-webyarn installgit init . && git add . && git commit -m "Init"yarn dev
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 20 (6 by maintainers)
Tried this out locally and saw a few issues (not sure which one is the actual problem)
apps/native’sdevscript asks to instalexpo-cliglobally. Not sure if it’s waiting for user input to proceed or not (maybe a-yflag or some autoinstall script would help? or documentation should include ayarn global add expo-cli)react-native. The version is pinned, so I’m not sure how this could have broken on its own, but it’s complaining aboutTouchableOpacitycomponent. Maybe we should simplify our example not to depend on _actual_components of ReactNative, since our examples are to show how Turbo works, not React native.I’m not familiar with RN or Expo, so I didn’t go further than this at the moment
Thanks @butadpj, Now all platforms work properly. your configuration needs the
"bundler": "metro",in theapp.jsonfile below the"web"key. The rest of things were settled up already.I want to post a question on the StackOverflow and it would be a good log for the community.
hey @amerllica, since you’re still getting the same error. Here’s the minimal example of turborepo with expo router. I’ve documented all the steps taken to setup
expo-router. Hope you find it helpful!I can’t even install the packages from the root directory. I’m getting this error when I run
npm installThe TS issue with
TouchableOpacityI believe required the specific version of react types - we’ve had to fix it once here already: https://github.com/vercel/turbo/pull/2181/files