Skip to content

Commit dae3475

Browse files
author
Luca Forstner
authored
fix(nextjs): Use basePath option for tunnelRoute (#8454)
1 parent c55943f commit dae3475

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/nextjs/src/config/webpack.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,10 @@ function addValueInjectionLoader(
865865

866866
const isomorphicValues = {
867867
// `rewritesTunnel` set by the user in Next.js config
868-
__sentryRewritesTunnelPath__: userSentryOptions.tunnelRoute,
868+
__sentryRewritesTunnelPath__:
869+
userSentryOptions.tunnelRoute !== undefined
870+
? `${userNextConfig.basePath ?? ''}${userSentryOptions.tunnelRoute}`
871+
: undefined,
869872

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

0 commit comments

Comments
 (0)