Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sentry Next.js stack traces display original typescript code #6619

Locked
InnaAndreeva started this conversation in General
Discussion options

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?

You must be logged in to vote

Replies: 1 comment

Comment options

Duplicate of #6621

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /