Crashlytics Stack Traces
We use React Native Firebase Crashlytics for error reporting from user devices.
#
JS Error Stack TracesIf a JS error is thrown, the error gets reported to Firebase Console as either the following stack trace format
or as
Both formats above are hard to read and impossible to debug. To make them readable, we can use the tool stack-beautifier.
#
Decrypt JS Stack Trace- Make sure to install the cli tool stack-beautifier globally.
- Checkout the commit which is tagged with the respective version from the error report on Firebase Crashlytics. E.g. if the error occurred on version 1.11.0 run:
- Create the same build as in the respective error report on Firebase Crashlytics. E.g. if the JS error occurred on an Android device with the production app run:
Locate the source map file. On Android the respective source map files should be under
android/app/build/generated/sourcemaps/
. On iOSTODO
.Create a
.txt
file with the obfuscated JS stack trace. Note, that only the JS stack trace is relevant. So if you have a stack trace in the format as in the first example above, you only need to paste
- Pre-process stack trace by running
This makes sure that the JSC stack trace is parsable by stack-beautifier.
- Beautify the stack trace by running
E.g. if you named the stack trace file stack-trace.txt
and pasted the content from the previous example run