GithubHelp home page GithubHelp logo

bugsnag / bugsnag-expo Goto Github PK

View Code? Open in Web Editor NEW
10.0 22.0 5.0 2.66 MB

License: MIT License

JavaScript 84.50% Shell 2.28% Ruby 2.31% Gherkin 10.91%
bugsnag notifier platforms bug bugs crash-reporting crash-reporting-tool debug debugging-tool error-handling

bugsnag-expo's People

Contributors

bengourley avatar cawllec avatar djskinner avatar fractalwrench avatar gingerbenw avatar hannah-smartbear avatar imjoehaines avatar joshedney avatar joshuapinter avatar kattrali avatar kennethlynne avatar kstenerud avatar lemnik avatar linusu avatar loopj avatar maciekstosio avatar mattdyoung avatar nickdowell avatar pustovalov avatar snmaynard avatar tomlongridge avatar twometresteve avatar yousif-bugsnag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bugsnag-expo's Issues

Error: Upload source maps to Bugsnag on eas build

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",

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

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',

App crashes after eas update, works locally

Describe the bug

Hi, I'm added bugsnag to my project and I get the data from local testing, but when I "publish" my app through eas update it crashes when the code reaches Bugsnag.start() (I know it's this line cause I removed it and moved around to test it).
The biggest problem is that I don't know how to get any useful logs when it crashes, I tried to wrap in try catch but it didn't help. If you have an idea how to get the logs, I could try to resolve the issue myself.

Steps to reproduce

  1. expo init
  2. create blank app
  3. npx bugsnag-expo-cli init (and follow basic init guide)
  4. expo update --platform=ios
  5. open expo go and run update
  6. see crash

Environment

  • Bugsnag version: latest
  • Expo SDK version (e.g. SDK 44): 49.0.5
  • Device: iphone 13 mini

Example Repo

Building Android with EAS Build, the build fails due to Gradle with Bugsnag

Describe the bug

When I try to run EAS build on Android, I'm getting this error message.

`Running 'gradlew :app:bundleRelease' in /home/expo/workingdir/build/android
Downloading https://services.gradle.org/distributions/gradle-7.5.1-all.zip
10%
20%.
30
%.
40%
50
%.
60%.
70%.
80%.
90
%.
100%
Welcome to Gradle 7.5.1!
Here are the highlights of this release:

Task :react-native-gradle-plugin:pluginDescriptors
Task :react-native-gradle-plugin:processResources
Task :react-native-gradle-plugin:compileKotlin
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (157, 32): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (163, 31): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt: (171, 36): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt: (114, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with root to point to your root project and reactNativeDir to point to the folder of the react-native NPM package
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (27, 51): 'BaseVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (130, 12): 'ApplicationVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (131, 12): 'LibraryVariant' is deprecated. Deprecated in Java
w: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt: (251, 14): 'BaseVariant' is deprecated. Deprecated in Java
Task :react-native-gradle-plugin:compileJava NO-SOURCE
Task :react-native-gradle-plugin:classes
Task :react-native-gradle-plugin:inspectClassesForKotlinIC
Task :react-native-gradle-plugin:jar
[stderr]
FAILURE: Build failed with an exception.
[stderr]

  • Where:
    [stderr]
    Build file '/home/expo/workingdir/build/android/app/build.gradle' line: 375
    [stderr]
  • What went wrong:
    [stderr]
    A problem occurred evaluating project ':app'.
    [stderr]

Failed to apply plugin 'com.bugsnag.android.gradle'.
[stderr]
Using com.bugsnag.android.gradle:8+ with Android Gradle Plugin < 8 is not supported. Either upgrade the Android Gradle Plugin to 8, or use an earlier version of the BugSnag Gradle Plugin. For more information about this change, see https://docs.bugsnag.com/build-integrations/gradle/
[stderr]

  • Try:
    [stderr]

Run with --stacktrace option to get the stack trace.
[stderr]
Run with --info or --debug option to get more log output.
[stderr]
Run with --scan to get full insights.
[stderr]

  • Get more help at https://help.gradle.org
    [stderr]
    BUILD FAILED
    [stderr]
    in 1m 40s
    5 actionable tasks: 5 executed
    Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.`

I tried removing bugsnag package from my project, and the build works.
I have also tried downgrading bugsnag package to version 44 ( this is my last project version before bumping up Expo SDK) and the build works.

It seems like expo build is on SDK 47 is using Gradle 7.5.1.

My project have these dependencies from bugsnag:
"@bugsnag/expo": "^47.0.0",
"@bugsnag/plugin-expo-eas-sourcemaps": "^47.0.0",
"@bugsnag/source-maps": "^2.3.1",

Steps to reproduce

Im not sure to report to expo or bugsnag but since the error seems like caused by bugsnag specifically, I decided to report here instead.

Environment

  • Bugsnag version: 47.0.0 & 47.1.0 (tried both)
  • Expo SDK version (e.g. SDK 44): SDK47
  • OS: Android

Support customization of the appVersion for sourcemap uploads.

Description

In my app, I use an app version string that includes the git sha (such as 1.3.12-abcdef), and I specify this explicitly when I . I do this to allow me to have a unique app version for each call to eas update, and have separate source maps each time I publish. However, I am unable to configure the sourcemaps upload for a new build, so each build has an invalid version (until it receives an OTA update from eas update).

Describe the solution you'd like
It would be great if the plugin could be configurable, so I can set a custom appVersion for the sourcemap upload.

Describe alternatives you've considered
To work around this, I am modifying my app.json file during my CI step to inject the expo.version that I want the sourcemaps to be published with.

v51's expo-secure-store dependecy breaks web compatibility

Describe the bug

expo-bugsnag v51.x added expo-secure-store as peer-depedency. This package doesn't work on the web platform and causes the app to crash on runtime.

A possible fix would be to use AsynStorage when running in the web platform.

Steps to reproduce

  1. Launch the app on the web

Environment

  • Bugsnag version: 51.0.0
  • Expo SDK version: 51
Error messages:
Uncaught TypeError: _ExpoSecureStore.default.getValueWithKeySync is not a function

Bugsnag generates new Build Phase every `npx expo prebuild`

Describe the bug

Every time the npx expo prebuild command is fired it will update the project.pbxproj file with new Build Phase of "Upload source maps to Bugsnag".

Screenshot 2023-10-04 at 16 41 44

Environment

  • Bugsnag version: "@bugsnag/expo": "^49.0.0",
  • Expo SDK version: SDK 49
  • iOS
  • Bare workflow in use of eas build

Cannot run bugsnag when using app.config.js (dynamic app.json)

Describe the bug

Modern expos allow using app.config.js rather than app.json.

If app.json is missing, or is missing an "expo": {} element, the init command fails:

zumthor$ npx bugsnag-expo-cli init
✔ @bugsnag/expo already appears to be installed, do you want to install it and its dependencies anyway? … no
✔ What is your Bugsnag API key? … deadbeef4acab110b32b3a1234567890
> Inserting API key into app.json

  TypeError: Cannot read properties of undefined (reading 'extra')
      at module.exports (/Users/flip/.npm/_npx/c6a5a58d15e1cf59/node_modules/bugsnag-expo-cli/lib/set-api-key.js:9:33)
      at async module.exports (/Users/flip/.npm/_npx/c6a5a58d15e1cf59/node_modules/bugsnag-expo-cli/commands/set-api-key.js:18:15)
      at async module.exports (/Users/flip/.npm/_npx/c6a5a58d15e1cf59/node_modules/bugsnag-expo-cli/commands/init.js:11:3)
      at async go (/Users/flip/.npm/_npx/c6a5a58d15e1cf59/node_modules/bugsnag-expo-cli/cli.js:39:21) 

Workaround

  1. Create a placeholder app.json: echo '{ "expo": {} }' > app.json
  2. Follow the instructions as given
  3. hand-replay the new parts of app.json into the config
  4. remove app.json

Steps to reproduce

  1. switch from app.json to app.config.js
  2. run npx bugsnag-exp-cli init
  3. dies editing app.json

It will also die if the app.json lacks an expo field: i.e. app.json == {} yields sadness, app.json = { "expo": {} } yields workaround.

Example code snippet

Vanilla repo, change to dynamic config:

cd /tmp
expo init foo -t blank
cd foo
# (will attest that the config hasn't changed)
npx expo config --json | jq '. | del(._internal) | { expo: . }' > cfg-vanilla.json
( echo -n "const AppConfig = (" ; cat app.json ; echo ")" ; echo  "export default AppConfig" ) > app.config.js
mv app.json away-app.json
npx expo config --json | jq '. | del(._internal) | { expo: . }' > cfg-dynamic.json

# this will be empty, the configs are the same
diff cfg-dynamic.json cfg-vanilla.json 

Demonstrate the bug:

quickbeam main /tmp/foo$ npx bugsnag-expo-cli init

✔ @bugsnag/expo does not appear to be installed, do you want to install it and its dependencies? … yes
✔ If you want to install @bugsnag/expo ^46.0.0 hit enter, otherwise type the version you want … ^46.0.0
> Installing @bugsnag/expo. This could take a while!
✔ What is your Bugsnag API key? … deadbeef4acab110b32b3a1234567890
> Inserting API key into app.json

  Error: Couldn’t find app.json in "/private/tmp/foo". ....

Demonstrate the workaround:

/tmp/foo$ echo '{ "expo": {} }' > app.json
/tmp/foo$ npx bugsnag-expo-cli init
/tmp/foo$ cat app.json

... then replay the changes from app.json into your config file.

Environment

  • Bugsnag version: 46
  • Expo SDK version (e.g. SDK 44): 46
  • Device (e.g. iphonex): cli
Error messages:

  TypeError: Cannot read properties of undefined (reading 'extra')
      at module.exports (/Users/flip/.npm/_npx/c6a5a58d15e1cf59/node_modules/bugsnag-expo-cli/lib/set-api-key.js:9:33)
      at async module.exports (/Users/flip/.npm/_npx/c6a5a58d15e1cf59/node_modules/bugsnag-expo-cli/commands/set-api-key.js:18:15)
      at async module.exports (/Users/flip/.npm/_npx/c6a5a58d15e1cf59/node_modules/bugsnag-expo-cli/commands/init.js:11:3)
      at async go (/Users/flip/.npm/_npx/c6a5a58d15e1cf59/node_modules/bugsnag-expo-cli/cli.js:39:21) 

Native crashes not reported

Describe the bug

Before all, thanks for working on the lib!

When I trigger a native crash, I don't see it reported on BugSnag.

Steps to reproduce

Here's how I triggered a native crash:

  1. Go to a native component used by your app which has an onPress callback
  2. On iOS, add @throw [NSException exceptionWithName:@"IntentionalCrashException" / On Android, throw new RuntimeException("This crash is intentional for testing purposes");
  3. Rebuild
  4. Click on your custom component: app natively crashes
  5. Reopen the app on iOS to ensure native report is sent

Environment

  • Bugsnag version: @bugsnag/expo: ^50.0.0
  • Expo SDK version (e.g. SDK 44): expo: ~50.0.19
  • Device: tested on iPhone 13 / iPhone 15 / Android 14 ; Debug & Release mode ; no debugger attached on iOS

Analysis

I'm using a managed workflow on expo, using expo prebuild to generate iOS and Android folder locally (and EAS build in CD).

There might be something wrong: when I open the generated AppDelegate, I don't see any [Bugsnag start] in the didFinishLaunchingWithOptions - as seen in the classical BugSnag React Native guide: https://docs.bugsnag.com/platforms/react-native/react-native/manual-setup/#app-delegate
I can't find Bugsnag pod either.

Because BugSnag is not natively started, I understand I don't see native reports.

Same on Android : opening MainApplication.kt, I don't see Bugsnag.start(this) in the onCreate function.

Did I miss something in the setup, or does the expo bugsnag plugin only works for JS errors? (which does work well on my project)

Error when uploading source maps from EAS build

Describe the bug

After submitting a built to EAS:

  1. Android built successfully and source maps were uploaded.
  2. iOS failed with the following error:
› Executing Flowchase » Upload source maps to Bugsnag
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸ 	PhaseScriptExecution Upload\ source\ maps\ to\ Bugsnag /Users/expo/Library/Developer/Xcode/DerivedData/Flowchase-dqtytsgkfadtwteridyhlzhrlmyt/Build/Intermediates.noindex/ArchiveIntermediates/Flowchase/IntermediateBuildFilesPath/Flowchase.build/Release-iphoneos/Flowchase.build/Script-026EE93FE26B4D48B5B4D384.sh (in target 'Flowchase' from project 'Flowchase')

To be clear: this causes an iOS build to fail.

Let me know if there's any extra info I can provide, I'd like to help :)

Steps to reproduce

???

Environment

  • Bugsnag version: 46.0.0
  • Expo SDK version (e.g. SDK 44): 46.0.9
  • Device (e.g. iphonex): N/A
  • @bugsnag/plugin-expo-eas-sourcemaps: 46.0.0
Error messages:
› Executing Flowchase » Upload source maps to Bugsnag
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸ 	PhaseScriptExecution Upload\ source\ maps\ to\ Bugsnag /Users/expo/Library/Developer/Xcode/DerivedData/Flowchase-dqtytsgkfadtwteridyhlzhrlmyt/Build/Intermediates.noindex/ArchiveIntermediates/Flowchase/IntermediateBuildFilesPath/Flowchase.build/Release-iphoneos/Flowchase.build/Script-026EE93FE26B4D48B5B4D384.sh (in target 'Flowchase' from project 'Flowchase')

Expo: Android: upload to bugsnag requires api key

After the update, We get this error:

in fastlane step: send_build_to_bugsnag
[12:40:16]: A Bugsnag API key is required to release a build. Set com.bugsnag.android.API_KEY in your AndroidManifest.xml to detect API key automatically.

it was working before the upgrade.

I think if this meta-info is need, it should be add by the plugin in the pre-build step instead of us doing it.

Make Bugsnag Source Map Upload Work With EAS Update

Description

I had to push a quick bug fix via EAS Update but now the source maps no longer work - or at least another runtime exception logged after the update does not have the sources mapped.

Describe the solution you'd like
When one runs

eas update --branch production --message 'Updating the app'

upload the source maps.

Android sourcemaps not uploaded

Describe the bug

I'm using expo with @bugsnag/plugin-expo-eas-sourcemaps. After eas build iOS sourcemaps are uploaded but nothing about Android. Also bugsnag logs not present in EAS Build logs.

Environment

  • Bugsnag version: 48.1.0
  • Expo SDK version (e.g. SDK 44): 48.0.17

EAS Build failure: Failed to load app.json file

Describe the bug

Hello,
I saw this failure in my EAS android build:

$ npx bugsnag-eas-build-on-success

Error: Failed to load app.json file /home/expo/workingdir/build/app.json.
Error: Cannot find module '/home/expo/workingdir/build/app.json'
Require stack:
- /home/expo/workingdir/build/node_modules/@bugsnag/plugin-expo-eas-sourcemaps/lib/eas-build-on-success.js

I believe it's because my Expo app uses app.config.ts instead of app.json. I noticed the eas-build-on-success.js file only looks for app.json:

let appConfig, apiKey
  try {
    appConfig = require(`${PROJECT_ROOT}/app.json`)
    apiKey = appConfig?.expo?.extra?.bugsnag?.apiKey
  } catch (error) {
    console.error(`Error: Failed to load app.json file ${PROJECT_ROOT}/app.json.\n${error}`)
    exit(1)
  }

It should also look for app.config.ts or app.config.js, the same way that Expo does.

Steps to reproduce

  1. Init a new Expo app
  2. Change app.json to app.config.js
  3. Submit an Android build to Expo EAS

Environment

  • bugsnag-source-maps version: 2.3.1
  • Uploading for:
    • Browser
    • Node
      • Node version:
    • React Native
      • React Native version: 0.71.3
  • Command that was run:
    npx bugsnag-eas-build-on-success

Support latest netinfo (relax peer dependency rule)

Description

Running EAS build I am getting the following error if I install react native netinfo 8.3.0

[stderr] warning "@bugsnag/expo > @bugsnag/[email protected]" has incorrect peer dependency "@react-native-community/[email protected]".

[stderr] warning "@bugsnag/expo > @bugsnag/[email protected]" has incorrect peer dependency "@react-native-community/[email protected]".

Describe the solution you'd like
Support package versions in the same minor range

Build fail with android com.bugsnag.android.gradle 8+

Expo prebuild:

Build start failing because of the latest android gradle plugin is not versioned.

    apply plugin: 'com.bugsnag.android.gradle'

    bugsnag {
        uploadReactNativeMappings = true
    }

The latest release here is gradle 8: https://github.com/bugsnag/bugsnag-android-gradle-plugin/releases

The build error.

A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.bugsnag.android.gradle'.
Using com.bugsnag.android.gradle:8+ with Android Gradle Plugin < 8 is not supported. Either upgrade the Android Gradle Plugin to 8, or use an earlier version of the BugSnag Gradle Plugin. For more information about this change, see https://docs.bugsnag.com/build-integrations/gradle/

Builds with "expo publish" do not have the right sourcemap configurations.

Describe the bug

On new build updates with "expo publish", the reported bugs do not have the right source map configurations.

Steps to reproduce

  1. Using @bugsnag/expo and @bugsnag/plugin-expo-eas-sourcemaps v48.
  2. Currently we use eas builds but have not migrated to eas updates due to an outstanding blocking issue: #48
  3. Make an eas build (any platform), and do an update with expo publish.
  4. Source maps are uploaded correctly for both eas builds and expo publish. Confirm on the bugsnag settings dashboard.
  5. Any bugs notified from the published do not have the right sourcemaps configurations and do not have the unobfuscated stacktraces.

Environment

  • Bugsnag version: 48.1.0
  • Expo SDK version (e.g. SDK 44): 48
  • Device (e.g. iphonex): Any

What's happening

I went ahead and looked into what changed since this used to work before v48.
I believe the culprit is a731586
This change removes setting the right codeBundleId on the bugsnag notifier. It seems premature to do so since expo publish is still around, and bugsnag still doesn't officially support eas update.

Publish release on production profile only

Currently it appears to not be possible to upload sourcemaps conditionally for iOS.
Maybe the right question is "Why is there different logic for Android and IOS source map upload trigger?"

With Android it is possible via eas-build-on-success hook. Example:

package.json

"eas-build-on-success": "./eas-build-on-success.sh"

eas-build-on-success.sh

#!/bin/bash

if [[ "$EAS_BUILD_PROFILE" == "production" ]]; then
  echo "Production profile detected."
  npx bugsnag-eas-build-on-success
else
  echo "Non-production profile detected. Skipping hook."
fi

Due to iOS not using this hook I cannot control the conditions for publishing release & uploading sourcemaps.

Let's harmonize the logic?

Plugins order conflict - @bugsnag/plugin-expo-eas-sourcemaps && sentry-expo

Describe the bug

trying to integrate sentry at the same time as we have bugsnag works fine. we notice that The @bugsnag/plugin-expo-eas-sourcemaps isn't too friendly to other scripts.

Having this order in app.config.ts

plugins: [
...
'@bugsnag/plugin-expo-eas-sourcemaps',
'sentry-expo',
...
]

Will generate this issue
PhaseScriptExecution Upload\ source\ maps\ to\ Bugsnag /Users/expo/Library/Developer/Xcode/DerivedData/projectName/Build/Intermediates.noindex/ArchiveIntermediates/projectName/IntermediateBuildFilesPath/projectName.build/Release-iphoneos/projectName.build/Script.sh (in target 'projectName' from project 'projectName')

changing the order works fine

plugins: [
...
'sentry-expo',
'@bugsnag/plugin-expo-eas-sourcemaps',
...
]

Steps to reproduce

Setup Sentry and Bugsnag in same project outing the plugins in the order mentioned above.

Environment

  • Bugsnag version: 48.1.0
  • Expo SDK version (e.g. SDK 44): 48
  • Device (e.g. iphonex): IPhone SE

Expo constants are undefined when executing tests

Describe the bug

A clear and concise description of what the bug is.
I'm running into an error which says "Can't read manifest of undefined" when running tests. I do have a mock in place but i guess the issue lies within bugsnag-expo

For some weird reason, Constants appear as undefined here

if (Constants.manifest) {

Please do note that i have a mock function which mocks the expo constants as well

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Environment

  • Bugsnag version: 47.1.0
  • Expo SDK version (e.g. SDK 44): SDK 47 EAS Build
  • Device (e.g. iphonex):

Example Repo

  • Create a minimal repository that can reproduce the issue
  • Link to it here:

Example code snippet

# (Insert code sample to reproduce the problem)
Error messages: ● Test suite failed to run
TypeError: Cannot read property 'manifest' of undefined

  at Object.<anonymous> (node_modules/@bugsnag/expo/src/config.js:12:15)
  at Object.<anonymous> (node_modules/@bugsnag/expo/src/notifier.js:17:64)

This might be the possible fix :
expo/eas-cli#1265 (comment)

If yes, please implement it and publish it in a next release so i could use it

TypeError: Cannot read property 'developer' of null

Describe the bug

After upgrade @bugsnag/expo to 49.0.0 this error manifest on a standalone app.

I saw in the code base on the lib, and i think that the problem is here

Capture d’écran 2023-08-02 à 09 40 39

developer is not a key of Constants.expoConfig object.

Steps to reproduce

  1. Upgrade @bugsnag/expo to 49.0.0
  2. Run standalone app
  3. See error

Environment

  • Bugsnag version: 49.0.0
  • Expo SDK version: 49.0.0
  • Device (e.g. iphonex): Android Oppo
Error messages:
TypeError: Cannot read property 'developer' of null

Add Support for Expo SDK 51

Description

Expo SDK 51 has been released as of May 7th 2024, hope to have this new version in order to be able to update to the new react native architecture in my projects.

ExpoSDK-51 Changelog

  • Would be nice to now the time estimate to have this update in case that I need to remove bugsnag dependency for the time being in order to update the SDK to the latest.

Additional context

Support SDK 45

Description

SDK 45 is released and it is currently not supported

Describe the solution you'd like

SDK 45 should be supported

Describe alternatives you've considered

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.