Open mikeewhite opened 5 years ago
Thanks for the detailed report @mikeewhite!
I gather from your README that you're running separate builds: One as part of running the app, and one to generate a source map. Did I get that right? I suspect this might be at least part of the problem, as the ordering of modules inside a bundle is in general nondeterministic across builds. Would you be able to try again, with both the executed bundle and the source map coming from the same build?
Hi @motiz88 - thanks for the fast response!
Yes, I'm running (for example) react-native run-android ...
and react-native ram-bundle ...
separately.
How would I go about running the two together? Can I send a cURL request to the running metro server to get the source map?
Hi @motiz88 - I added the following to my example app's android/app/build.gradle
:
project.ext.react = [
extraPackagerArgs: ["--sourcemap-output", "$buildDir/android.release.ram.bundle.map"],
...
]
And re-ran react-native run-android --variant release
and repeated my tests (using the sourcemap output into my build directory) and got exactly the same results.
Is that a good enough test (to determine whether the nondeterministic build is having an effect)?
Thanks @mikeewhite, seems clear that this isn't a nondeterminism issue then.
cc @cpojer - RAM bundle source maps seem to be borked. I've seen similar problems in my own testing.
It looks like this is still an issue in RN v0.60.
@motiz88 @cpojer are there any plans to fix this in the near future?
@motiz88 is there something that we can help with to move this forward? thanks.
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.
App.js:13
App.js:21
badCode.js:3
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.
And the resulting mappings are out of alignment (for both iOS and Android):
App.js:10
App.js:20
badCode.js:1
App.js:45
<-- In this case the mapping is quite far away from the crashing lineI've included the command I used to generate the associated source maps in the readme of the example repository.