question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CodePush + Hermes Source maps not reflecting

See original GitHub issue

Environment

How do you use Sentry? sentry.io

Which SDK and version? “@sentry/react-native”: “^2.6.0” Reactnative v 64.2

Steps to Reproduce

  1. Generate a new codepush update with source maps with hermes enabled

  2. upload source maps to sentry with a custom release, dist names using this command

    sentry-cli react-native appcenter \ ${projectName} ${PLATFORM} "./build/release/$PLATFORM/CodePush" \ --deployment "Production" \ --release-name "android.4.0.7+codepush:4070-03" \ --dist "4070-03"

  3. crash the app with a javascript error

Expected Result

Get the error with a full stack trace

Actual Result

I got the error with just minified frames event though that the error release and dist is the same with the artifacts as seen in the images

s2 s1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jennmuengcommented, Jul 28, 2021

Here is the update to the Hermes sourcemaps documentation: https://github.com/getsentry/sentry-docs/pull/3391

Temporary deployment link: https://sentry-docs-5x88knmcu.sentry.dev/platforms/react-native/manual-setup/hermes/#custom-source-maps

Please let me know if this works.

0reactions
alex-a-pereiracommented, Aug 2, 2021

@alex-a-pereira One note, we don’t recommend calling Sentry.init inside codePush.getUpdateMetaData as its an asynchronous call that would delay the initialization of Sentry and not catch any errors/crashes that happen before the call is completed.

Usually we recommend storing your release, environment, and release values somewhere with your bundle that you’ll be able to read right away as soon as the JavaScript engine initializes. For example, in package.json and reading the version from there.

This is an incompatibility with how CodePush recommends people use the versioning from getUpdateMetadata and Sentry that needs to be initialized as soon as possible.

Thanks, we changed out approach for this reason. We were previously initting sentry twice (once at JS bundle mount, again after getUpdateMetadata promise resolves) which was casuing some issues. I’ve updated my comment above in case anyone else stumbles across this thread

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hermes, sentry source map is showing wrong code in ... - GitHub
Hermes, sentry source map is showing wrong code in both codepush and production build, but not when running in dev #2087.
Read more >
CodePush for React Native | Sentry Documentation
These values need to be unique to each version of your codebase and match the version on the source maps exactly, or they...
Read more >
React Native source maps - JavaScript - Bugsnag docs
The guide on this page shows how to upload source maps on-demand, which is useful when: You're using CodePush; You don't want to...
Read more >
Source Maps - React Native
Source maps allows to map a transformed file back to the original source file. The main purpose of source maps is to aid...
Read more >
Advanced Setup for React Native - Sentry Documentation
If you wish to upload the source maps and symbols to Sentry, create a new Run Script build ... Referenced from: /usr/local/bin/node Reason:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found