-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nitro] H3 error is not forwarded from an import #11769
Comments
The difference is just between |
As a feature, we can support returning an error object for h3 but indeed it works as expected. (unjs/h3#28) |
I see, it would be nice to have a different error page for api (sending back json). |
@atinux It happens when using curl or JSON client (https://github.com/nuxt/framework/blob/0e93d752fd128dd93e1f59c35ac8d4a95ff0aebb/packages/nitro/src/runtime/server/error.ts#L11) same as nuxt2 but would be nice idea indeed passing formatted JSON object to error page :) |
That would be great indeed 😀 |
Will be closed with linked renovate PR - see unjs/h3@991fcff. |
It seems the H3 error is not detected when used from another file.
Reproduction: https://codesandbox.io/s/shy-tdd-7oe13?file=/server/api/fails.ts
Works: https://7oe13.sse.codesandbox.io/api/works
Fails: https://7oe13.sse.codesandbox.io/api/fails
The text was updated successfully, but these errors were encountered: