question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EAS Build looks in wrong place for Sentry CLI

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
byCedriccommented, 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 ❤️

1reaction
byCedriccommented, Sep 15, 2022

That’s definitely a good workaround for now. At least until https://github.com/getsentry/sentry-react-native/issues/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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EAS Build looks in wrong place for Sentry CLI #32
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...
Read more >
eas cli build android fail with errors - #13 by wodin
I decided to build with yarn and not npm so it will align with eas build. eas build. Looks like it is working...
Read more >
Troubleshooting for React Native
Try passing --force-foreground to the Sentry CLI command in the build script. This is possibly a bug with our CLI that we are...
Read more >
Sentry source maps uploading with wrong (un-interpolated ...
We recently upgraded @sentry/react-native to 4.7.1 (cli to 2.8.0) and, after some tinkering to get the source maps uploading again, ...
Read more >
JavaScript - Docs - Sentry Documentation
We strongly recommend that if you use defer , you a) place the script tag for ... that configures source maps and uploads...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found