-
Notifications
You must be signed in to change notification settings - Fork 49
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
expo: not working with pnpm isolated deps #34
Comments
EDIT: |
@steinroe Thanks for the fix! |
adding |
That's true! We ended up not adding the expo app to the monorepo because of it... do you have an example of setting up metro properly? Would love to add it back in! |
All you really need to do is add rnx-kit/metro-config per the docs and react-native/expo should work with pnpm. I had to add a couple packages to .npmrc public-hoist-pattern because some react-native build is still configured with hardcoded paths that rely on sub-dependencies being flattened into node-modules. Here's what I added:
The only tough issue I've run into so far is that one package (@react-native-google-signin/google-signin) won't build on android because gradle gets confused by symlinks and believes that there are duplicate classes. |
@evelant does the rnx-kit approach work with EAS builds? If so did it require any Thanks! |
@leggomuhgreggo Yep the rnx-kit/metro-symlinks-resolver is actually all you need, plus installing a copule of extra dev dependencies since pnpm doesn't allow undeclared deps and there are actually quite a few that are undeclared in expo (that is expo relies on them being flattened into node_modules so that they just happen to resolve by chance when using yarn/npm). You can actually see a minimal example here: https://github.com/evelant/test-pnpm-ios-headers-path-bug That won't build on iOS because of One other note is that I found the EAS build machines have an outdated pnpm. I had to add |
No kiddin! This is very exciting news. Thank you @evelant! Update: I tried this out and got it to work! Golly, what a delightful turn of events. I can confirm that bit about needing a later version of pnpm than I may throw together an example repo for other folks who're interested -- and hopefully follow up on some of these questions:
But I feel like the In any case -- thanks again for shining a light on it! Old NotesHow are you managing your app-level package.json? (gonna start playing with this now -- thanks again!) EDIT:
I remember hearing that the initial 7.0.0 version of pnpm had a couple issues that needed to be patched. Is that why you bumped it in the pre install script or was it just on general principles? EDIT2: Looks like the latest EAS build image (updated earlier today) has pnpm 7.11.0 🎉 EDIT3: I guess pnpm 7.11.0 is only available on the latest iOS image -- the latest Android infra still seems to use 7.0.0. I haven't checked with Android yet, but all my EAS build attempts that didn't specify |
@leggomuhgreggo I'm using this setup in a monorepo no problem. Just set up your repo per the pnpm instructions on workspaces and your packages will work. You don't need much at all in your top level package.json with pnpm other than scripts and the I've actually put experimenting with As for esbuild there's @rnx-kit/metro-serializer-esbuild but that doesn't work in development, seems it's only for production bundling. Personally I didn't want to take the risk of having different behavior in production due to using a different bundling process. I'm actually building my app with |
@leggomuhgreggo did you ever have a chance to put together a minimal repo of this? |
@evelant ... this is kind of off-topic but since you mentioned it, is @react-native-google-signin/google-signin deprecated in favor of expo-auth-session/providers/google? or do they have different capabilities? |
to add to what @evelant said about using the metro config . I have tried combinging that with the symlink resolver in a fresh app (pnpm, nx, expo) and it appears to be serving fine on iphone simulator |
refs: - https://pnpm.io/workspaces - https://turbo.build/repo/docs - nrwl/nx-labs#34 - https://docs.expo.dev/guides/monorepos/ - https://docs.expo.dev/guides/monorepos/#create-our-first-app - https://forums.expo.dev/t/react-native-google-mobile-ads-expo-web/68400 - rhyek/expo-monorepo-issue@pnpm...pnpm-fixed
refs: - https://pnpm.io/workspaces - https://turbo.build/repo/docs - nrwl/nx-labs#34 - https://docs.expo.dev/guides/monorepos/ - https://docs.expo.dev/guides/monorepos/#create-our-first-app - https://forums.expo.dev/t/react-native-google-mobile-ads-expo-web/68400 - rhyek/expo-monorepo-issue@pnpm...pnpm-fixed
refs: - https://pnpm.io/workspaces - https://turbo.build/repo/docs - nrwl/nx-labs#34 - https://docs.expo.dev/guides/monorepos/ - https://docs.expo.dev/guides/monorepos/#create-our-first-app - https://forums.expo.dev/t/react-native-google-mobile-ads-expo-web/68400 - rhyek/expo-monorepo-issue@pnpm...pnpm-fixed
refs: - https://pnpm.io/workspaces - https://turbo.build/repo/docs - nrwl/nx-labs#34 - https://docs.expo.dev/guides/monorepos/ - https://docs.expo.dev/guides/monorepos/#create-our-first-app - https://forums.expo.dev/t/react-native-google-mobile-ads-expo-web/68400 - rhyek/expo-monorepo-issue@pnpm...pnpm-fixed
Hey!
Thanks for your work, highly appreciated!
Unfortunately, we are using pnpm in our mono repo and it seems like the expo plugin does not work with that. We continue to get errors like
and
I also tried is by cloning the example https://github.com/xiongemi/nx-expo-poetry. Using it with npm works fine, but after deleting package-lock.json and installing dependencies with pnpm, it is again unable to start. The only way it works with pnpm if I use pnpm import to import the lock file. Is there something I can do to make it work with a fresh pnpm install?
The text was updated successfully, but these errors were encountered: