Error logging to Sentry.io - source maps not working

Hi, has anyone managed to log errors to sentry.io with correct source mapping? I am using ravenjs for the integration.

Yes, it’s working fine, steps to make it works
1- npm install raven-js --save
2- add declare module ‘raven-js’; to declaration.d.ts file
3- import Raven from “raven-js”; in app.module at the top of the file
4-
Raven.config(’[YOUR SN]’).install();
export class RavenErrorHandler implements ErrorHandler {
handleError(err:any): void {
Raven.captureException(err.originalError || err);
}
}
5- under the provider just add a new provider for it as below
{provide: ErrorHandler, useClass: RavenErrorHandler}

thats it.

Yes, I managed to make it work by stripping the file paths from the stack trace, that might be why it’s not working for you.

I wrote a tutorial for it, you can see there how to strip the file paths.

3 Likes

Ive been pulling my hair out over the souremaps, thanks for the tutorial- / as prefix :trophy:

Hi @ashteya we have integrated sentrio.io in our ionic3 app some weeks ago by doing your tutorial.

The tutoria is great but we are not able to get it work with sourcemap

Using latest ionic3 with app-scripts 3.0.0 the sourcemap now are loaded to .sourcemaps folder.

So after running a production build for android ionic cordova build android --prod --release we upload the sourcemap doing this
sentry-cli releases -o blablabla -p blablabla files x.x.x upload-sourcemaps --url-prefix / .sourcemaps

But at the end we are running always into a mystic error without typescript error

can you help?

Hi @filipsuk, where you able to get it work with sourcemap?

I created a new post for my problem