Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Bugsnag Source Map Upload Work With EAS Update #48

Open
thorbenprimke opened this issue Aug 4, 2022 · 13 comments
Open

Make Bugsnag Source Map Upload Work With EAS Update #48

thorbenprimke opened this issue Aug 4, 2022 · 13 comments
Labels
awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. feature request Request for a new feature scheduled Work is starting on this feature/bug

Comments

@thorbenprimke
Copy link

thorbenprimke commented Aug 4, 2022

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.

@luke-belton
Copy link
Member

Hi @thorbenprimke - we have an item on our backlog to add support for EAS Update in the future. I don't have an exact timescale for that at the moment, but I'll make sure that we keep this thread updated on progress 👍

@luke-belton luke-belton added feature request Request for a new feature backlog We hope to fix this feature/bug in the future labels Aug 5, 2022
@stephenlaughton
Copy link

hey @luke-belton any news on this? EAS updates is now in GA and many more users are using it. if ETA is somewhat far away can you point us to documentation that we can use to develop a workaround in the meantime?

@foolem
Copy link

foolem commented Sep 5, 2022

+1

@evelant
Copy link

evelant commented Sep 6, 2022

EAS update is now the "official" way to deploy updates to Expo apps. @luke-belton could you provide a workaround for us to use until this is ready?

Hopefully this can get prioritized since it will impact almost every expo user going forward.

@stephenlaughton
Copy link

stephenlaughton commented Sep 6, 2022

agreed. i already posted above @luke-belton but this is a really huge issue for us right now and looking into the upload code provided in the repo it is a bit of a jungle of gradle and shell scripts across each platform.

can you point us to a simple API call that can be made manually to get sourcemaps up on bugsnag? a CURL command? anything would be useful at this point. i can't see bugsnag being viable for expo users moving forward unless this is solved.

edit: i see this is labelled as backlog and feature request. this really should be an urgent bug unless expo support is not a priority, in which case it will be easier to look for other options.

@luke-belton
Copy link
Member

Hi all - thanks for your thoughts on this and apologies for the delayed update. There are still some ongoing discussions internally on how best to support this, as well as some potential constraints around the current eas update command in terms of uploading source maps.

We hope to resolve these and also provide a recommendation for a manual approach in the interim - I’ll do my best to get an update out on this thread as soon as possible, hopefully by the end of the week 👍

@luke-belton luke-belton added scheduled Work is starting on this feature/bug and removed backlog We hope to fix this feature/bug in the future labels Sep 7, 2022
@luke-belton
Copy link
Member

Hi - thanks for your patience on this. Currently, EAS Update doesn't have a hook that's suitable for getting a unique ID with each update.

At this stage, we'd therefore recommend bumping your app version each time you run the eas update command. You should then be able to use a command similar to the following after running the update to upload your source maps to Bugsnag, noting that you'll need to use the same app version in your Bugsnag configuration code and your source map upload:

bugsnag-source-maps upload-react-native \
    --api-key <YOUR_API_KEY> \
    --platform android \
    --app-version <YOUR_APP_VERISON> \
    --source-map "./dist/bundles/$(ls ./dist/bundles | grep "android.*.map")" \
    --bundle "./dist/bundles/$(ls ./dist/bundles | grep "android.*.js")"

You can replace android with ios in the above code to upload your iOS maps/bundles.

As stated above, we are looking to add official support for EAS Updates, which will hopefully be possible in the near future once it has a hook or similar that we can use to get what we need on each update.

Let me know if you have any questions about this approach 👍

@greis
Copy link

greis commented Sep 15, 2022

@luke-belton Not sure if it's the same issue or not but I'm using EAS Update with Expo Go and I tried to manually upload the source maps with the bugsnag-source-maps upload-react-native command but the source maps didn't work. Do you know if this something that only works with EAS builds or if it should work on Expo Go as well?

@luke-belton
Copy link
Member

Hi @greis - apologies for the slow response on this. In my testing I've been able to get sourcemaps working as expected using the method outlined above, running the update in Expo Go.

Could you possibly write into [email protected] with links to events in Bugsnag that are failing to map so that we can investigate this for you please?

@johnkiely1
Copy link
Member

Hi @greis, have you managed to make any progress with this? Are you sourcemaps working as expected now?

@johnkiely1 johnkiely1 added the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label Oct 24, 2022
@thorbenprimke
Copy link
Author

@luke-belton - just wanted to let you know that the snippet you shared seems to work as expected. I've used it for a few OTA updates and any new crashes show the expected stack traces.

Thanks!

@kennethlynne
Copy link
Contributor

I was very confused how to get source maps. The expo docs are very confusing on the topic (see expo/expo#19934) and the bugsnag docs say that we only get source maps for release builds whatever that means. The CLI supports dumping source maps already (see expo/eas-cli@7ebb547).

Sentry makes this seemingly super easy and configurable (see https://docs.expo.dev/guides/using-sentry) so I hope bugsnag can adopt a similar approach and help out on the bugsnag expo docs.

I will however try out the workaround suggested, which was very much appreciated :)

@johnkiely1
Copy link
Member

johnkiely1 commented Nov 10, 2022

Hi @kennethlynne.
The docs as provided by Expo are managed by Expo and seem to be a combination of wording used by them and a copy of some of the Bugsnag Expo documentation. I believe this was created prior to EAS support so arguably omits some of the relevant information. I'm sure you've already seen the official Bugsnag installation docs here. This amounts to an additional plugin for sourcemap uploads on EAS builds which will also get automatically installed if the Bugsnag Expo installation cli is used. This should automatically upload source maps for release (non-development) builds.

To try to add some clarity around the release/development distinction I believe it is covered here from an EAS build perspective.

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. feature request Request for a new feature scheduled Work is starting on this feature/bug
Projects
None yet
Development

No branches or pull requests

8 participants