How do you manage to parse stack traces like this ? is there a doc about it
anonymous@1:557290
v@1:550772
d@1:550459
o@1:550087
anonymous@1:557270
v@1:550772
d@1:550416
o@1:550087
global@1:549807
This is unfortunately underdocumented at the moment. You can symbolicate it using the metro-symbolicate package (installed by default in the RN template project), and pass it the generated source map and a stack trace:
npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map < stacktrace.txt
Note:
metro-symbolicate exits immediately with success, make sure the input comes from a pipe or redirection, and not from a terminal. adb logThis is unfortunately underdocumented at the moment. You can symbolicate it using the
metro-symbolicatepackage (installed by default in the RN template project), and pass it the generated source map and a stack trace:npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map < stacktrace.txtNote:
- The build process generates multiple source maps, one from the packager, one from the compiler, and one that merges the previous two. You have to use the merged map.
- If
metro-symbolicateexits immediately with success, make sure the input comes from a pipe or redirection, and not from a terminal.- The stack trace can be clean like yours, or in the midst of other information as when piped directly from
adb log
Life saver, thx a lot :]
As an update, this is now part of the official React Native docs: https://reactnative.dev/docs/next/symbolication
Most helpful comment
This is unfortunately underdocumented at the moment. You can symbolicate it using the
metro-symbolicatepackage (installed by default in the RN template project), and pass it the generated source map and a stack trace:Note:
metro-symbolicateexits immediately with success, make sure the input comes from a pipe or redirection, and not from a terminal.adb log