Skip to content

plugin-expo-eas-sourcemaps is not compatible with monorepos #46

Open
@thorbenprimke

Description

@thorbenprimke

Describe the bug

Add the plugin-expo-eas-sourcemaps config plugin to an expo project in a monorepo. It does not work due to the node_modules path not being what is expected in the scripts.

Steps to reproduce

  1. Set up a monorepo with workspaces
  2. Add the app at like packages/app
  3. Kick off an EAS build and see it fail

Environment

  • Bugsnag version: 45.0.0
  • Expo SDK version: SDK 45

Example code snippet - patch packages that resolves it (but not in a dynamic manner)

diff --git a/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/lib/bugsnag-expo-xcode.sh b/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/lib/bugsnag-expo-xcode.sh
index cc52c28..bce3d79 100755
--- a/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/lib/bugsnag-expo-xcode.sh
+++ b/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/lib/bugsnag-expo-xcode.sh
@@ -58,4 +58,4 @@ if [ ! -z "$ENDPOINT" ]; then
   ARGS+=("$ENDPOINT")
 fi
 
-../node_modules/.bin/bugsnag-source-maps upload-react-native "${ARGS[@]}"
+../../../node_modules/.bin/bugsnag-source-maps upload-react-native "${ARGS[@]}"
diff --git a/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/src/ios.js b/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/src/ios.js
index e18e9c8..b01bd40 100644
--- a/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/src/ios.js
+++ b/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/src/ios.js
@@ -31,7 +31,7 @@ function withIosPlugin (config, onPremConfig) {
     bundleReactNativePhase.shellScript = modifiedScript
 
     // 03. Configure the new build phase
-    const shellScript = 'SOURCE_MAP="$TMPDIR/$(md5 -qs "$CONFIGURATION_BUILD_DIR")-main.jsbundle.map" ../node_modules/@bugsnag/plugin-expo-eas-sourcemaps/lib/bugsnag-expo-xcode.sh'
+    const shellScript = 'SOURCE_MAP="$TMPDIR/$(md5 -qs "$CONFIGURATION_BUILD_DIR")-main.jsbundle.map" ../../../node_modules/@bugsnag/plugin-expo-eas-sourcemaps/lib/bugsnag-expo-xcode.sh'
 
     xcodeProject.addBuildPhase([], buildPhaseName, 'Upload source maps to Bugsnag', null, {
       shellPath: '/bin/sh',

Metadata

Metadata

Assignees

Labels

awaiting feedbackAwaiting a response from a customer. Will be automatically closed after approximately 2 weeks.bugConfirmed bugfeature requestRequest for a new featurereleasedThis feature/bug fix has been released

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions