-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
sentry-cli fails in yarn monorepo setup #1857
Comments
Hi! My name is Cedric and I work for Expo, just want to pitch in and find some options to resolve this. With Expo SDK 43, one of the new focuses is adding support for monorepositories. I noticed the hardcoded path in the Gradle script as well. We can resolve this in Is it safe to add that |
indeed, |
@HazAT is gonna follow up on this. |
Little note on this. On Expo's EAS Build, the following script in
We ended up having to set our React Native app to no-hoist, which isn't ideal but unblocks us for now. |
We have some code ready to auto-fill the |
Hey @byCedric, I tried your fix on my monorepo and unfortunately getting the same issues as both before and with my attempt at a fix (which I believe does the same thing). You can see the build for this here, assuming you have privileges: https://expo.dev/accounts/attio/projects/mobile-app/builds/77ad6652-de8d-477c-9a42-0617b321d878 Here is the bulk of the error on iOS:
The issue seems to be |
Managed to get this working by symlinking |
if you do the manual configuration https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/ you could specify the path of the directory either via symlink as @Braden1996 did or really setting up the correct path. I'm not sure we can do something about it, ideas? |
Thanks @byCedric for raising this issue. We've had to fallback to a JS Sentry instrumentation in production. With the sentry-expo config plugin enabled, our app builds locally, but fails on EAS (for both android and ios). It's an Expo 42 expo-yarn-workspaces monorepo architecture, but other config plugins build fine. Our implementation is similar to the one found here. Is it possible that the EAS build issues we are experiencing are related to this issue? The build fails at the very end of Fast Lane process:
We've tried configuring cli.executable and setting up a postinstall-symlink-react-native symlink, with no success. Any other suggestions on how we might debug and resolve this? |
Have you tried SDK 43 by chance? There was a lot of added monorepo support in that release. We're currently running a monorepo w/ sentry-expo and it seems to be working now (with the |
@byCedric See: https://github.com/getsentry/sentry-react-native/blob/master/sentry.gradle#L95 Although for iOS, unfortunately, this is not true, the CLI path has to be changed in the sentry build phase script, usually under the Build phases: or just search for |
I've raised this issue #1912 |
Hi @Braden1996, Expo 43 migration is in progress. Ran into a bunch of little issues like this, but overall quite happy with the changes. In regards to sentry, I was able to get Native Reporting to work by adding the "postinstall-symlink-react-native",
That took way longer than I'd like to admit to figure out. Not sure if this is related to my application environment, or overwriting the react-native symlink, but disabling the hook enabled the builds to pass on EAS. |
@Braden1996 Can you share your nohoist config? Did you set nohoist for the entire monorepo or just for specific Sentry packages? Thanks. |
If you still have some issues, you can try this: byCedric/expo-monorepo-example#32 (comment) |
We have an expo app inside a yarn monorepo workspace and our build fails with:
The call to
/build/workingdir/build/apps/sh.hae.app/node_modules/@sentry/cli/bin/sentry-cli
fails because yarn installs @sentry/cli in the workspace root i.e./build/workingdir/build/node_modules
not inside theapps/sh.hae.app
subdirectory.This should be the culprit line:
sentry-react-native/sentry.gradle
Line 95 in b7b1372
Expo uses
require.resolve
within gradle to find package locations in yarn monorepos. e.g.new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute().text.trim(), "../native_modules.gradle");
maybe this is a possible solution(first reported to expo/sentry-expo#217)
The text was updated successfully, but these errors were encountered: