diff --git a/packages/nextjs/src/client/routing/appRouterRoutingInstrumentation.ts b/packages/nextjs/src/client/routing/appRouterRoutingInstrumentation.ts index 9bb6e6288a84..b281d5121626 100644 --- a/packages/nextjs/src/client/routing/appRouterRoutingInstrumentation.ts +++ b/packages/nextjs/src/client/routing/appRouterRoutingInstrumentation.ts @@ -129,7 +129,8 @@ export function appRouterInstrumentNavigation(client: Client): void { function transactionNameifyRouterArgument(target: string): string { try { - return new URL(target, 'http://some-random-base.com/').pathname; + // We provide an arbitrary base because we only care about the pathname and it makes URL parsing more resilient. + return new URL(target, 'http://example.com/').pathname; } catch { return '/'; }