Skip to content
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

EAS Build looks in wrong place for Sentry CLI #32

Open
jamesisaac opened this issue Nov 8, 2021 · 6 comments
Open

EAS Build looks in wrong place for Sentry CLI #32

jamesisaac opened this issue Nov 8, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@jamesisaac
Copy link

Hi there, thanks for the recent work in improving monorepo support in Expo 43, much appreciated.

I've followed along closely to the changes here and in Expo 43, and attempted to follow a similar migration path for one of my projects (Expo Managed workflow) so it can take advantage of EAS Build and Submit.

It has worked well overall, and I was able to get an Expo 43 monorepo project building on EAS Build for iOS and Android. However, when I then try and do the final remaining step of removing expo-yarn-workspaces (which seemed necessary as it was causing issues in the Expo Web app), this breaks the mobile app under EAS Build on the Sentry step. The error reported by EAS Build servers suggests that it's looking in the child package node_modules folder for Sentry, which it won't be able to find anymore as expo-yarn-workspaces is not doing symlinking.

Android error from EAS build log

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload_42'.
[stderr] > A problem occurred starting process 'command '/build/workingdir/build/packages/mobile/node_modules/@sentry/cli/bin/sentry-cli''

iOS error from EAS build log

› Executing RapidStaging » Bundle React Native code and images

❌  error: No such file or directory (os error 2)

I've checked carefully and do believe I'm following all the relevant steps for Sentry setup.

packages/mobile/app.config.js snippet

module.exports = () => {
  // ...
  return {
    expo: {
      // ...
      plugins: ['sentry-expo'],
      hooks: {
        postPublish: [
          {
            file: 'sentry-expo/upload-sourcemaps',
            config: {
              organization: 'redacted',
              project: 'redacted',
              authToken: 'redacted',
            },
          },
        ],
      },
    },
  };
};

packages/mobile/package.json snippet

  "dependencies": {
    "@sentry/react-native": "^2.6.0",
    "expo": "^43.0.2",
    "sentry-expo": "^4.0.0",
  },

Is there some way of hinting to the sentry-expo "plugin" that the project is a monorepo, so it can make the appropriate adjustments for locating Sentry CLI? Everything I'm reading says that in Expo 43 symlinking with expo-yarn-workspaces is no longer necessary and module resolution should just work, but that doesn't seem to be the case here.

yarn.lock package versions:

  • @sentry/react-native: 2.6.2
  • expo: 43.0.2
  • sentry-expo: 4.0.3
@jamesisaac jamesisaac added the bug Something isn't working label Nov 8, 2021
@byCedric
Copy link
Owner

byCedric commented Nov 9, 2021

Hi @jamesisaac! We are working with Sentry to get this resolved asap, you can follow along here getsentry/sentry-react-native#1857

@jamesisaac
Copy link
Author

Excellent, thanks! Sorry, presumed sentry-expo was in the expo monorepo, or I would have spotted expo/sentry-expo#217

@byCedric
Copy link
Owner

byCedric commented Nov 9, 2021

No worries! We probably will encounter this for some libraries in the future. But, we are actively trying to solve these types of issues either on our (Expo) side, or with the library maintainers. I'm glad you are one of the community members who warns us of these types of issues, so we can resolve them. Thanks for that ❤️

@czystyl
Copy link

czystyl commented Sep 12, 2022

I managed to make it work in ejected and not ejected expo projects. The problem only occurred in monorepo; the main problem is that the Sentry CLI path is hardcoded.

Ejected Expo:

This expo/sentry-expo#217 (comment) (iOS section) will do the project to build with EAS correctly.

Not ejected Expo:

By adding nohoist option to yarn workspace:

"nohoist": [
    "@react-native-community/cli-platform-ios",
    "@react-native-community/cli-platform-android",
    "@sentry/cli",
    "@sentry/react-native",
    "expo",
    "react-native",
    "jsc-android",
    "hermes-engine",
    "sentry-expo"
  ]

@byCedric
Copy link
Owner

That's definitely a good workaround for now. At least until getsentry/sentry-react-native#1912 is solved. If Sentry respects the path on iOS (on Android they already do I believe), we can actually use that instead of the workaround.

@farmstrong8
Copy link

farmstrong8 commented Jun 15, 2023

@byCedric still seeing this issue in a monorepo with expo 48
image
My error is a little bit different but i assume it is related. Build passes for android. Im using npm so I don't have the nohoist option, is there another work around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants