@sentry/browser
@sentry/node
raven-js
raven-node
_(raven for node)_6.0.0
I have followed this documentation to setup the source maps:
Looked at these previous issues for help:
Directory Setup:
- /dist
- /src
....
tsconfig.json
:
{
"compilerOptions": {
"allowJs": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"baseUrl": "./",
"declaration": false,
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": true,
"isolatedModules": false,
"lib": ["ES2018"],
"module": "commonjs",
"moduleResolution": "node",
"noEmit": false,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "./dist",
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"sourceRoot": "/",
"strict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "ES2019",
"types": ["node", "jest"],
"typeRoots": ["./node_modules/@types", "./src/@types"]
},
"exclude": ["node_modules", "dist"]
}
Placed this at the top of /src/server.ts
as outlined in the documentation:
declare global {
namespace NodeJS {
interface Global {
__rootdir__: string
}
}
}
global.__rootdir__ = __dirname || process.cwd()
Initializing sentry like so:
import * as Sentry from '@sentry/node'
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
release: process.env.GITHUB_SHA,
enabled: true,
integrations: [
new RewriteFrames({
root: global.__rootdir__
})
],
debug: true
})
Uploading Source Maps in publish_sentry_source_maps.sh
:
sentry-cli releases new "$GITHUB_SHA"
sentry-cli releases files "$GITHUB_SHA" upload-sourcemaps ./dist
sentry-cli releases finalize "$GITHUB_SHA"
JS and Source Maps are being published successfully and I can see them in my release. The exception is still showing up as pure JS instead of the expected TS. I haven't been able to find any other errors when debugging or through sentry processing.
An example of this issue can be seen here: https://sentry.io/organizations/mastery-logistics-systems/issues/2167890062/?project=5600691&query=is%3Aunresolved
@kamilogorek tagging you because it seems like you were pretty knowledgable on other similar issues. I would greatly appreciate any help, thanks!
@rdelander change
sentry-cli releases files "$GITHUB_SHA" upload-sourcemaps ./dist
to
sentry-cli releases files "$GITHUB_SHA" upload-sourcemaps ./dist --url-prefix '~/dist'
Frame URL has to match the one from uploaded artifacts.
@kamilogorek That fixed my issue. Thank you so much
Most helpful comment
@rdelander change
to
Frame URL has to match the one from uploaded artifacts.