Hermes: Parse hermes stacktrace

Created on 23 Jun 2020  路  3Comments  路  Source: facebook/hermes

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

Most helpful comment

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:

  • 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-symbolicate exits 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

All 3 comments

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:

  • 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-symbolicate exits 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

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:

  • 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-symbolicate exits 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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

djschilling picture djschilling  路  6Comments

Kikketer picture Kikketer  路  3Comments

NWU-NISL picture NWU-NISL  路  4Comments

benjamingr picture benjamingr  路  6Comments

tsengvn picture tsengvn  路  4Comments