| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
size-limit report 📦
|
Sorry, something went wrong.
|
|
||
| if (isNitroV3) { | ||
| addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler.server')); | ||
| addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name.server')); | ||
| // On Nitro 3, the parametrized route name and `url.path.parameter.*` attributes are set by | ||
| // `@sentry/server-utils`' `nitroIntegration` (auto-injected via `@sentry/node` defaults) for | ||
| // API routes, and by `route-detector.server` for SSR page routes, so no Nuxt route-name | ||
| // plugin is needed. Legacy Nitro (v2) has no such channels and keeps its own. | ||
| } else { | ||
| addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/handler-legacy.server')); | ||
| addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/update-route-name-legacy.server')); |
There was a problem hiding this comment.
Bug: Removing update-route-name.server results in generic API route transaction names when tracing is disabled, as the replacement nitroIntegration is only active with tracing.
Severity: MEDIUM
The update-route-name.server plugin should be retained to ensure API route names are correctly parameterized for all users, including those who do not have performance tracing enabled. This guarantees consistent behavior regardless of the user's tracing configuration.
Prompt for AI AgentReview the code at the location below. A potential bug has been identified by an AI agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not valid. Location: packages/nuxt/src/module.ts#L112-L121 Potential issue: The pull request removes the `update-route-name.server` Nitro plugin, assuming that the `nitroIntegration` will handle API route naming. However, the `nitroIntegration` is only added to default integrations when tracing is enabled (e.g., `tracesSampleRate` is set). For users who only use Sentry for error tracking without tracing, or who set `defaultIntegrations: false`, this change will cause Nitro API routes to have generic, unparameterized transaction names. The removed plugin was the sole mechanism ensuring correct route naming in these common configurations.
Did we get this right? 👍 / 👎 to inform future reviews.
Sorry, something went wrong.
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>
|
actually, this fails on nuxt 5, so closing this pr |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Stacked on #24869.
On Nitro 3, @sentry/server-utils' nitroIntegration — auto-injected via @sentry/node's default integrations — already sets the parametrized route name (setHttpServerSpanRouteAttribute) and the url.path.parameter.* / params.* attributes for API routes, and route-detector.server handles SSR page routes (the /** catch-all case nitroIntegration skips). Nuxt's update-route-name.server set the exact same attributes on the same span.
Unlike the storage duplication (#24869), this produced no duplicate spans — just redundant, idempotent attribute writes — so there's no behavior change, only a cleanup. The v3 update-route-name.server plugin is removed; the shared updateRouteBeforeResponse hook stays (still used by the legacy Nitro 2 plugin and the Cloudflare plugin), and legacy Nitro keeps its own route-name plugin.
🤖 Generated with Claude Code