-
-
Couldn't load subscription status.
- Fork 1.7k
Sentry Next.js stack traces display original typescript code #6619
-
Hello!
I am using a @sentry/nextjs package to submit build artifacts to Sentry.io. However Sentry displays javascript code because typescript code compiles into javascript. Such traces are quite hard to read for our team.
My tsconfig.json looks like
{
"extends": "./tsconfig",
"compilerOptions": {
"sourceMap": true,
"inlineSources": true,
"sourceRoot": "/"
}
}Where tsconfig is standard Next.js tsconfig.json file.
sentry.client.config.js and sentry.server.config.js files contain integrations property configured such way
import { RewriteFrames } from '@sentry/integrations'; const SENTRY_DSN = 'https://my-awesome-dsn'; Sentry.init({ dsn: SENTRY_DSN, // Adjust this value in production, or use tracesSampler for greater control tracesSampleRate: 1.0, integrations: [ new RewriteFrames({ root: process.cwd(), }), ], });
So root property contains the path to the root directory with typescript code.
Could you tell, If it possible to load original typescript files into Sentry and render stack traces with TS code?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Duplicate of #6621
Beta Was this translation helpful? Give feedback.