You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{defineHandler}from'nitro/h3';exportdefaultdefineHandler(()=>{thrownewError('Sentry error tracing is working!');});
Expected Result
Should report one error to Sentry
Specific errors like 401 should not be reported to Sentry
Actual Result
Errors show up twice in Sentry, once as Error and once as HttpError
Specific errors like 401 are reported to Sentry (once) as HttpError
Additional Context
Found that @sentry/nitro reports 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 +1 or me too, to help us triage it.
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')){returnnull;}returnevent;},});
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.
Activity
linear-code commentedon Oct 1, 2026
JS-3861
[-]Errors are reported twice[/-][+]Nitro: Errors are reported twice[/+]MickL commentedon Oct 1, 2026
Workaround until fixed, in
instrument.mjs: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.
nicohrubec commentedon Oct 2, 2026
Hey, thanks for raising! I just merged a fix so this should be working correctly in the next release.
fix(nitro): Capture errors only through the Nitro error hook (getsent…
fix(v10/nitro): Capture errors only through the Nitro error hook (#24963
github-actions commentedon 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.