Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.53.1
Framework Version
7.53.1
Link to Sentry event
No response
SDK Setup
let nextConfig = {
basePath: '/something',
}
nextConfig = withSentryConfig(
nextConfig,
{
silent: true,
release: env.BUILD_ID,
},
{
widenClientFileUpload: true,
transpileClientSDK: true,
tunnelRoute: '/monitoring',
hideSourceMaps: true,
disableLogger: true,
},
);
Steps to Reproduce
Sentry tries to connect to example.com/monitoring instead of example.com/something/monitoring.
Changing tunnelRoute to /something/monitoring doesn't work either as the rewrite doesn't match since Next.JS would be trying to match /something${tunnelRoute} which is /something/something/monitoring.
Expected Result
Either the base path is taken into account automatically by the plugin or the rewrite specifies basePath: false and its left up to the user to provide the base path manually when specifying the tunnel route eg. tunnelRoute: `${MY_BASE_PATH}/monitoring`.
Actual Result
Using basePath along with tunnelRoute from sentry results in 404 errors if the application is actually deployed on that base path and a different application handles routes outside of it.
Reference https://github.com/getsentry/sentry-javascript/blob/develop/packages/nextjs/src/config/withSentryConfig.ts
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.53.1
Framework Version
7.53.1
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
Sentry tries to connect to
example.com/monitoringinstead ofexample.com/something/monitoring.Changing
tunnelRouteto/something/monitoringdoesn't work either as the rewrite doesn't match since Next.JS would be trying to match/something${tunnelRoute}which is/something/something/monitoring.Expected Result
Either the base path is taken into account automatically by the plugin or the rewrite specifies
basePath: falseand its left up to the user to provide the base path manually when specifying the tunnel route eg.tunnelRoute: `${MY_BASE_PATH}/monitoring`.Actual Result
Using
basePathalong withtunnelRoutefrom sentry results in 404 errors if the application is actually deployed on that base path and a different application handles routes outside of it.Reference https://github.com/getsentry/sentry-javascript/blob/develop/packages/nextjs/src/config/withSentryConfig.ts