stacktrace.js icon indicating copy to clipboard operation
stacktrace.js copied to clipboard

How to use offline sourcemaps

Open proProbe opened this issue 9 years ago • 1 comments

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,
        );
    });

proProbe avatar Oct 28 '16 09:10 proProbe

Take a look at this https://github.com/invertase/react-native-firebase/issues/2327

maggialejandro-rp avatar Jan 31 '20 15:01 maggialejandro-rp