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
In the Nuxt issue, I suggested a solution in the now removed normalizeError function, but that solution doesn't apply here since the function was removed.
The only way I have found that an error will show nicely, is when setting the response status to 500, and providing text.
Personally I would also like to see some sort of stack trace for further debugging, but I will leave that up to be debated about.
As mentioned by Daniel Roe, using createError is indeed the preferred way of returning an error. But that still does not properly show the error if you don't explicitly set statusMessage
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Nitro: 2.10.4
Node: 18.20.3 (stackblitz) and 20.16.0 (local test)
Reproduction
https://stackblitz.com/edit/github-3wg9izmg?file=nitro.config.ts&view=editor
Describe the bug
When returning an error like this:
The error reason is not shown in the console when prerendering:
This case is the same if an error is thrown, but then at least a stack trace will appear:
Additional context
This issue stems from this Nuxt issue, which stems from trying to debug this Pinia issue
In the Nuxt issue, I suggested a solution in the now removed
normalizeError
function, but that solution doesn't apply here since the function was removed.The only way I have found that an error will show nicely, is when setting the response status to 500, and providing text.Personally I would also like to see some sort of stack trace for further debugging, but I will leave that up to be debated about.
As mentioned by Daniel Roe, using
createError
is indeed the preferred way of returning an error. But that still does not properly show the error if you don't explicitly setstatusMessage
Logs
No response
The text was updated successfully, but these errors were encountered: