Uh oh!
There was an error while loading. Please reload this page.
feat(nuxt): improve error dx for users - #4539
Conversation
✅ Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: pooya parsa <pyapar@gmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Currently,
(*) Graceful client handling: Showing full-error page for Client-Side, is really unnecessary in many cases. For example, when a refresh button fails, we can avoid bailing the whole application into an error state. Using Error boundary is probably best but it is harder to use. |
* throwError falls back to normal error even if no context
Aareksio
commented
Jul 21, 2022
🔥 |
🔗 Linked issue
nuxt/nuxt#13788, resolvesnuxt/nuxt#13950
❓ Type of change
📚 Description
This PR improves the error experience for users:
throwErrortoshowErrorand allows graceful fallback when nuxt context is not availableshowErrorto acceptcreateErrorparams for better dxcreateErrorwithin the Vue lifecycle. (👈 This is now the recommended approach.) This is similar to usingcreateErrorin server api routes. On server side these will lead to a full page error, but on client can be handled with error boundaries,onErrorCaptured, and so on.📝 Checklist