Skip to content

typescript sourcemap mapping #8032

Closed as not planned
Closed as not planned
@kkh975

Description

@kkh975

Problem Statement

Environment

  • self-hosted
  • "@sentry/webpack-plugin": "^1.20.0"

Steps to Reproduce

I am applying TypeScript to the project.
When the webpack build is successful, the app.js and app.js.map files are created.
(Using devtool: 'source-map' in webpack options)
All uploads are also done successfully.

However, if an error occurs within the project, the log is based on the ts file.
Therefore, it is displayed as /Main.tsx in Main at line 66:9 in the Sentry issue screen.

The ts file is uploaded to the Sentry server, but
The ts.map file is not created, so it cannot be found.

스크린샷 2023-04-25 오후 8 32 08

This is sentry-webpack plugin

plugins: [
  new SentryWebpackPlugin({
    include: [
      {
        paths: [path.resolve(__dirname, '../../output/dist')],
        ext: ['js', 'map'],
      },
      {
        paths: [path.resolve(__dirname, '../../src/project')],
        urlPrefix: '~/project',
        ext: ['js', 'ts', 'jsx', 'tsx'],
      },
    ],
    rewrite: true,
    release: '1.0.0',
    cleanArtifacts: true,
    ignore: ['node_modules'],
    configFile: './sentryclirc',
  }),
  // ...
]

project index

import * as Sentry from '@sentry/react';
import { BrowserTracing } from '@sentry/tracing';

Sentry.init({
  dsn: 'http://.../1',
  release: '1.0.0',
  integrations: [new BrowserTracing()],
});

// ...

Is there any way to solve this problem?

Solution Brainstorm

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions