Open
Description
Hello!
Im currently working on a react-native
app and Im trying to integrate stacktrace.js with crashlytics that sends error messages from the phone to a service that enables me to have a better insight on what is going on. Im using stacktrace to get better tracing of the stack and have gotten it to work.
My question is how do I include a sourcemap? Im not totally sure how this should be done and have read through the documentation. I would also prefer to use an offline
sourcemap that will be generated and included in the app itself.
What I currently have as code:
...
return StackTrace.fromError(error, {offline: true}).then((stack) => {
return stack.map(row => {
let { lineNumber } = row;
const { source, fileName } = row;
if(!lineNumber) {
lineNumber = parseInt(source.split(':').slice(-2, -1)) || 0;
}
return {fileName: fileName, lineNumber, functionName: source};
});
}).then((stack) => {
Crashlytics.recordCustomExceptionName(
type,
errorMessage,
stack,
);
});