react / react/metro

RAM Bundles: Incorrect line mappings

Open
#399 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.6k
Forks
696
Avg merge
8m
Merged PRs (30d)
7

Description

The line mappings resolved from metro-symbolicate for RAM bundled applications appear to be broken.

I've created a simple example repository which uses the latest release of React Native (v0.59.5) and includes four crash scenarios (each one can be triggered by pressing the corresponding button).

Before enabling RAM bundles, I grabbed the line and column numbers from the top frame from each resulting stacktrace and converted them using the symbolicate.js script in metro-symbolicate and got the expected mappings, i.e.

  • Unhandled error 1 : App.js:13
  • Unhandled error 2 : App.js:21
  • Unhandled error 3 : badCode.js:3
  • Handled error 1 : App.js:32

I repeated the same test after enabling RAM bundles but passing the associated filenames for each frame into symbolicate.js, e.g.

./symbolicate.js <path-to-source-map> 364.js 1 250 

And the resulting mappings are out of alignment (for both iOS and Android):

  • Unhandled error 1 : App.js:10
  • Unhandled error 2 : App.js:20
  • Unhandled error 3 : badCode.js:1
  • Handled error 1 : App.js:45 <-- In this case the mapping is quite far away from the crashing line

I've included the command I used to generate the associated source maps in the readme of the example repository.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/metro-symbolicate/src/symbolicate.js and the linked RamBundleInvestigation README, then run its four crash scenarios for both iOS and Android. Compare the generated source maps and symbolicated results with the expected App.js and badCode.js locations; done means the RAM bundle mappings align with the crashing lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.