Repository navigation
Nitro: Errors are reported twice #24939
Copy link
Copy link
Closed
Description
Activity
- changed the title
[-]Errors are reported twice[/-][+]Nitro: Errors are reported twice[/+]on Oct 1, 2026 Workaround until fixed, in
instrument.mjs:Sentry.init({ dsn: process.env.NITRO_SENTRY_DSN, tracesSampleRate: 1, beforeSend: (event) => { // TODO: Remove, workaround until this is fixed: https://github.com/getsentry/sentry-javascript/issues/24939 if (event.exception?.values?.some(({ mechanism }) => mechanism?.type === 'auto.http.nitro.onTraceError')) { return null; } return event; }, });
This drops everything from the tracing channel (onTraceError) and keeps everything from Nitro's error hook (captureErrorHook), which is the path that skips 3xx/4xx.
Hey, thanks for raising! I just merged a fix so this should be working correctly in the next release.
Reacted by Mick LawitzkeReacted by Mick Lawitzke- added a commit that references this issue
on Oct 2, 2026 - added a commit that references this issue
on Oct 2, 2026 A PR closing this issue has just been released 🚀
This issue was referenced by PR #24952, which was included in the 11.3.0 release.
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsWaiting for: Product Owner
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nitro
SDK Version
11.1.0
Framework Version
11.1.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
Handler
/routes/sentry.tsfrom the docs:Expected Result
Actual Result
Errorand once asHttpErrorHttpErrorAdditional Context
Found that
@sentry/nitroreports errors from two places: The error hook (which filters 4xx) and the h3 tracing channel (which doesn't), causing duplicate reports and letting the 401 slip through unfiltered.Priority
Critical ?
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it.