Skip to content

Commit

Permalink
fix(nextjs): Use basePath option for tunnelRoute (#8454)
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored Jul 5, 2023
1 parent c55943f commit dae3475
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,10 @@ function addValueInjectionLoader(

const isomorphicValues = {
// `rewritesTunnel` set by the user in Next.js config
__sentryRewritesTunnelPath__: userSentryOptions.tunnelRoute,
__sentryRewritesTunnelPath__:
userSentryOptions.tunnelRoute !== undefined
? `${userNextConfig.basePath ?? ''}${userSentryOptions.tunnelRoute}`
: undefined,

// The webpack plugin's release injection breaks the `app` directory so we inject the release manually here instead.
// Having a release defined in dev-mode spams releases in Sentry so we only set one in non-dev mode
Expand Down

0 comments on commit dae3475

Please sign in to comment.