Skip to content

Commit fb27207

Browse files
mydeaclaude
andcommitted
fix(nuxt): Remove redundant Nitro 3 route-name plugin
On Nitro 3, `@sentry/server-utils`' `nitroIntegration` (auto-injected via `@sentry/node`'s defaults) already sets the parametrized route name and `url.path.parameter.*` attributes for API routes, and `route-detector.server` handles SSR page routes. Nuxt's `update-route-name.server` set the same attributes on the same span — redundant work with no extra telemetry — so it is removed for Nitro 3. Legacy Nitro (v2), which has no native tracing channels, keeps its own plugin, and the shared `updateRouteBeforeResponse` hook stays for the legacy and Cloudflare paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f882315 commit fb27207

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

‎packages/nuxt/src/module.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ export default defineNuxtModule<ModuleOptions>({
112112

113113
if (isNitroV3) {
114114
addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler.server'));
115-
addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name.server'));
115+
// On Nitro 3, the parametrized route name and `url.path.parameter.*` attributes are set by
116+
// `@sentry/server-utils`' `nitroIntegration` (auto-injected via `@sentry/node` defaults) for
117+
// API routes, and by `route-detector.server` for SSR page routes, so no Nuxt route-name
118+
// plugin is needed. Legacy Nitro (v2) has no such channels and keeps its own.
116119
} else {
117120
addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler-legacy.server'));
118121
addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name-legacy.server'));

‎packages/nuxt/src/runtime/plugins/update-route-name.server.ts‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)