Skip to content

compile a node+typescript project, then minify it, and have Sentry errors be trackable via SourceMap(s)

Notifications You must be signed in to change notification settings

colthreepv/sentry-ts-repro

Repository files navigation

sentry-ts-repro

The purpose is to compile a node+typescript project, then minify it, and have Sentry errors be trackable via SourceMap(s)

SPOILER ALERT: node 10.x produces wrong error col/lines on minified sourcecode (that should be the issue) node 12.x on the other hand produces correct ones, as it uses more recent V8.

Prerequisities

Configure ENV Variables:

export SENTRY_AUTH_TOKEN=<fill this>
export SENTRY_ORG=<fill this>
export SENTRY_PROJECT=<fill this>
export SENTRY_DSN=<fill this>

Build project

Clone this, then:

./build.sh build
node build/app.js

Build project minified

Clone this, then:

./build.sh minified
node minified/app.js

Finding the source line/column

Edit source-map.js and provide correct line/column values then node source-map.js

What to expect:

{
  source: '/src/lib.ts',
  line: 4,
  column: 30,
  name: null
}

Additional useful commands

Delete release files in between tries:

./clean-release.sh

About

compile a node+typescript project, then minify it, and have Sentry errors be trackable via SourceMap(s)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published