EAS Build looks in wrong place for Sentry CLI
See original GitHub issueHi 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.2expo
: 43.0.2sentry-expo
: 4.0.3
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
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 ❤️
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.