getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.86k stars 1.55k forks source link

urlPrefix not woking #4835

Closed stegano closed 2 years ago

stegano commented 2 years ago

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

6.19.1

Framework Version

6.19.1

Link to Sentry event

No response

Steps to Reproduce

  1. Add usePrefix setting in next.config.js file
    // next.config.js
    ...
    module.exports = withSentryConfig(nextJsConfigs, {
    ...
    usePrefix: '~/test',
    ...
    }
  2. Build NextJS to upload sourcemaps to Sentry server
    $ next build
  3. Go to the source maps in my project settings on the sentry.io website and check the list of files uploaded to archive for that version

Expected Result

The file path uploaded to the archive must start with ~/test/_next.

Actual Result

The file path uploaded to the archive starts with ~/_next.

stegano commented 2 years ago

If the include option value is not entered, the urlPrefix option does not seem to work. If I set the include option value, it works fine.

// next.config.js
...
module.exports = withSentryConfig(nextJsConfigs, {
 ...
  include: '.next/static/',
  usePrefix: '~/test',
  ...
}

Close the issue. I hope this issue helps someone.