bugsnag / bugsnag-expo

MIT License
11 stars 5 forks source link

Error: Upload source maps to Bugsnag on eas build #184

Closed Brunowilliang closed 3 weeks ago

Brunowilliang commented 4 months ago

Describe the bug

I am encountering an error when generating a build with EAS:

eas build --profile preview --platform ios --local

The error message is:

[RUN_FASTLANE] ⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » [project] » Build Phases » 'Upload source maps to Bugsnag'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script

Steps to reproduce

  1. Run the command eas build --profile preview --platform ios --local.
  2. Observe the error message related to ambiguous dependencies in the Bugsnag script.

Environment

"@bugsnag/expo": "^50.0.0",
"expo": "^50.0.14",
clr182 commented 4 months ago

Hi @Brunowilliang

The error message you have shared (Script has ambiguous dependencies causing... ) is not actually an error message, rather it is a warning that the build phase will run on every build. This is expected behaviour and will not be the source of a build failure.

Are you able to share any other error messages from the build logs with us for further investigation?

opmat commented 4 months ago

I am having almost the same issue but my error message is

The following build commands failed: PhaseScriptExecution Upload\ source\ maps\ to\ Bugsnag /Users/expo/Library/Developer/Xcode/DerivedData/MyFOBx-aewultoaqcctcddqtcgcnwgrbsym/Build/Intermediates.noindex/ArchiveIntermediates/MyFOBx/IntermediateBuildFilesPath/MyFOB.build/Release-iphoneos/MyFOB.xbuild/Script-20B5157C496745F3A31EB2E0.sh (in target 'MyFOBx' from project 'MyFOBx') (1 failure)

Environment "@bugsnag/expo": "^49.0.0", "expo": "~49.0.15", "@bugsnag/plugin-expo-eas-sourcemaps": "^49.0.0", "@bugsnag/source-maps": "^2.3.1",

mclack commented 4 months ago

Hi @opmat

Unfortunately there's not a lot to go on with that error message, although it appears like it may be attempting to upload a .sh file, rather than a mapping file. Could you please share some more information for us to look into this:

As this is a public thread, please feel free to open a ticket with us directly by contacting support@bugsnag.com, referencing this GitHub issue and sharing any necessary information for us to further investigate this.

opmat commented 3 months ago

@mclack Thanks for the feedback. It works fine when deploying for android but the error comes up only when deploying ios.

I setup Bugsnag using thee instruction on https://docs.bugsnag.com/platforms/react-native/expo/#installation-and-configuration

  1. as at today, I have the following Connfiguration "@bugsnag/expo": "^49.0.0", "expo": "~49.0.15", "@bugsnag/plugin-expo-eas-sourcemaps": "^49.0.0", "@bugsnag/source-maps": "^2.3.1",

    1. The command I am running is eas build --profile production -p ios --auto-submit
  2. app.json snippet
    "plugins": [
     "@bugsnag/plugin-expo-eas-sourcemaps"
    ],
    "extra": {
      "bugsnag": {
        "apiKey": "my-key"
      }
    }
summerkiflain commented 1 month ago

Hi, I am also facing the error during eas build --local.

Below is my environment:

"@bugsnag/expo": "^51.0.0",
"@sentry/react-native": "~5.22.0",
"expo": "~51.0.26",
"@bugsnag/plugin-expo-eas-sourcemaps": "^51.0.0",
"@bugsnag/source-maps": "^2.3.3",

log from FASTLANE is:

[RUN_FASTLANE] ▸ ** ARCHIVE FAILED **
[RUN_FASTLANE] ▸ The following build commands failed:
[RUN_FASTLANE] ▸    PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/summer/Library/Developer/Xcode/DerivedData/GamesTracker-ghcuxcrmaomrqffdafkpgtpscwzg/Build/Intermediates.noindex/ArchiveIntermediates/GamesTracker/IntermediateBuildFilesPath/GamesTracker.build/Release-iphoneos/GamesTracker.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'GamesTracker' from project 'GamesTracker')
[RUN_FASTLANE] ▸ (1 failure)
[RUN_FASTLANE] ** ARCHIVE FAILED **

I think here is the relevant log from xCode:

+ [[ true == true ]]
+ HBC_SOURCEMAP_FILE=/Users/xxxxxx/Library/Developer/Xcode/DerivedData/GamesTracker-ghcuxcrmaomrqffdafkpgtpscwzg/Build/Intermediates.noindex/ArchiveIntermediates/GamesTracker/BuildProductsPath/Release-iphoneos/GamesTracker.app/main.jsbundle.map
+ /private/var/folders/2r/4g55b_896rjgjlflst81bfrw0000gn/T/eas-build-local-nodejs/a6078bbc-7d13-40c9-8621-1fe7de841955/build/node_modules/@sentry/cli-darwin/bin/sentry-cli /private/var/folders/2r/4g55b_896rjgjlflst81bfrw0000gn/T/eas-build-local-nodejs/a6078bbc-7d13-40c9-8621-1fe7de841955/build/node_modules/react-native/scripts/compose-source-maps.js /Users/xxxxxx/Library/Developer/Xcode/DerivedData/GamesTracker-ghcuxcrmaomrqffdafkpgtpscwzg/Build/Intermediates.noindex/ArchiveIntermediates/GamesTracker/BuildProductsPath/Release-iphoneos/main.jsbundle.map /Users/xxxxxx/Library/Developer/Xcode/DerivedData/GamesTracker-ghcuxcrmaomrqffdafkpgtpscwzg/Build/Intermediates.noindex/ArchiveIntermediates/GamesTracker/BuildProductsPath/Release-iphoneos/GamesTracker.app/main.jsbundle.map -o /Users/xxxxxx/Library/Developer/Xcode/DerivedData/GamesTracker-ghcuxcrmaomrqffdafkpgtpscwzg/Build/Intermediates.noindex/ArchiveIntermediates/GamesTracker/IntermediateBuildFilesPath/GamesTracker.build/Release-iphoneos/GamesTracker.build/DerivedSources/main.jsbundle.map
node:internal/fs/utils:356
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/Users/xxxxxx/Library/Developer/Xcode/DerivedData/GamesTracker-ghcuxcrmaomrqffdafkpgtpscwzg/Build/Intermediates.noindex/ArchiveIntermediates/GamesTracker/BuildProductsPath/Release-iphoneos/main.jsbundle.map'
    at Object.openSync (node:fs:596:3)
    at Object.readFileSync (node:fs:464:35)
    at Object.<anonymous> (/private/var/folders/2r/4g55b_896rjgjlflst81bfrw0000gn/T/eas-build-local-nodejs/a6078bbc-7d13-40c9-8621-1fe7de841955/build/node_modules/react-native/scripts/compose-source-maps.js:34:8)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/xxxxxx/Library/Developer/Xcode/DerivedData/GamesTracker-ghcuxcrmaomrqffdafkpgtpscwzg/Build/Intermediates.noindex/ArchiveIntermediates/GamesTracker/BuildProductsPath/Release-iphoneos/main.jsbundle.map'
}

Node.js v18.20.4
Command PhaseScriptExecution failed with a nonzero exit code

Note: I am using both Sentry & Bugsnag for error reporting, strangely, If I keep only @sentry or @bugsnag, build works fine, but If I try to add both, build start to fail by giving above error.

RobertoSmartBear commented 3 weeks ago

Hi @opmat,

You've already received a response to the ticket you opened with us in Support, which is now closed, but for completeness and future use, I'm also reporting it here.

We have tried to reproduce what you are experiencing but we haven't been able to. Unfortunately, the logs provided don't give us enough additional information and it's difficult for us to say or investigate exactly why CFBundleShortVersionString can't be found.

We can't investigate any further at this time, but we would be happy to reopen the case if you could provide a stripped down reproduction of your application that replicates this behaviour.

RobertoSmartBear commented 3 weeks ago

Hi @summerkiflain,

The problem you experience is not something we can test. Like my colleague Christian mentioned in the other issue, we would recommend to only use BugSnag or Sentry due to the high potential for conflicts between the two SDKs.

sidorchukandrew commented 27 minutes ago

The Bugsnag config plugin is changing where main.jsbundle.map is output (see here). Then the bundle phase fails because it no longer knows where to find the file.

sidorchukandrew commented 21 minutes ago

I think Sentry needs to be informed of the new location of the sourcemap.