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
Looks like a flake from the middleware test, re-running it is making it pass. Checking to see if the test can be tightened up or if there is actually a possibility that middleware error capturing didn't go through.
I managed to reproduce the issue, it is very flakey (once every 10 runs sometimes).
Looks like theMiddleware error handling had a race condition where errors were sometimes captured with with mechanism auto.function.nuxt.nitro instead of auto.middleware.nuxt.
I found that the error was being bubbled up to the h3 error capture, but our captureException should've checked already if it was captured by the middleware. This doesn't seem to always work since the error thrown is H3Error and not the original thrown error inside the handler.
I checked to see if the .cause property would contain the original error and if it was marked as captured and it was, so it feels like we need to check for these as well otherwise we may end up capturing errors twice, or swallow the exact mechanism but I'm not sure if this is something we need to consider for the core package as well.
Creating a PR and starting a discussion around it.
Activity
linear commentedon Oct 24, 2025
JS-1092
logaretm commentedon Oct 24, 2025
Looks like a flake from the middleware test, re-running it is making it pass. Checking to see if the test can be tightened up or if there is actually a possibility that middleware error capturing didn't go through.
logaretm commentedon Oct 24, 2025
I managed to reproduce the issue, it is very flakey (once every 10 runs sometimes).
Looks like theMiddleware error handling had a race condition where errors were sometimes captured with with mechanism
auto.function.nuxt.nitroinstead ofauto.middleware.nuxt.I found that the error was being bubbled up to the h3 error capture, but our
captureExceptionshould've checked already if it was captured by the middleware. This doesn't seem to always work since the error thrown is H3Error and not the original thrown error inside the handler.I checked to see if the
.causeproperty would contain the original error and if it was marked as captured and it was, so it feels like we need to check for these as well otherwise we may end up capturing errors twice, or swallow the exact mechanism but I'm not sure if this is something we need to consider for the core package as well.Creating a PR and starting a discussion around it.
github-actions commentedon Nov 5, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #18035, which was included in the 10.23.0 release.