Disable Default Error Screen
Can someone tell me how to disable nuxt default error screen on production. show errors in console instead for breaking entier application. Thanks! (nuxt v3.11.1)

2 Replies
Hi @shoaib0987. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To disable the default error screen in Nuxt 3 production and show errors in the console instead, you have a few options:
Custom Error Handling
The most straightforward approach is to create a custom
error.vue
file in your project root. This allows you to override the default error page with your own implementation:
This will log errors to the console while preventing the full-screen error page from being displayed to users.
Using Error Plugins
You can also create a plugin to handle errors globally:
Using NuxtErrorBoundary
For more granular control, you can use the <NuxtErrorBoundary>
component in your layouts or pages to catch errors locally without triggering the full-screen error page:
This approach allows you to catch errors at specific levels of your application without breaking the entire app NuxtErrorBoundary.
Remember that in production, Nuxt already hides detailed error messages from users for security reasons, as implemented in this PR, but the error page itself will still show.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@803333276101116034> Kapa.ai is still learning and improving, please let me know how I did by reacting below.