Comments (4)
Alright, so I have changed the title of this issue to better represent my current understanding of how these pages work.
That 'fallback error page', which is not to be confused with the Error Page (i.e.: error.vue
), is handled by the configured Nitro error handler.
As per https://vuejs.org/api/application.html#app-config-errorhandler, https://nuxt.com/docs/getting-started/error-handling#vue-errors and https://nitro.unjs.io/config#errorhandler, a new error handler can be provided in nuxt.config.js
.
I truly couldn't find an example online, so I took upon myself to try it on this online code editor: https://stackblitz.com/edit/github-bf8y4g-7iqjdn?file=server%2Ferror.ts
Hopefully this helps someone else.
The new request for this issue:
Nuxt team, it would be fantastic if the page templates imported in /packages/nuxt/src/core/runtime/nitro/error.ts#L67 could be provided directly in nuxt.config.json
from nuxt.js.
Start a new pull request in StackBlitz Codeflow.
from nuxt.js.
If there is an error rendering the error page then we fall back to a static page. Your middleware means that it throws an error even when rendering the error page. Check the page route/path first.
from nuxt.js.
Hi @danielroe, thank you for your comment.
Could you please clarify what you mean by "Check the page route/path first" ?
That middleware is causing an error on purpose, outside of any pages.
What I was trying to point out is that the fallback error page we see pictured in my first comment, and linked in the reproduction Stackblitz, is not related to error.vue
, and even if editable in some way, not documented on the Nuxt website.
Those fallback templates are provided by @nuxt/ui-templates
(https://github.com/nuxt/nuxt/tree/main/packages/ui-templates).
Also seems to be imported here: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/runtime/nitro/error.ts#L67
How can I customize those fallback error page templates?
Thank you
from nuxt.js.
Related Issues (20)
- Module type augmentation conflict breaks types for `$config` property on `ComponentCustomProperties` on nightly release HOT 1
- First tRPC request always returns null inside onMounted HOT 6
- assign meta tag the data from api requests. HOT 4
- fetch data as meta tag HOT 3
- Nuxt3 .server (island) components fail to render "Request Header Fields Too Large" if you pass a lot of data to props HOT 1
- Nuxt SSR cant resolve local domain HOT 4
- Inject/Provide no longer works with defineNuxtComponent HOT 1
- Nuxt 3.12.4 with Tailwindcss Take too long in loading and HMR HOT 6
- NuxtErrorBoundary is't working when refresh page HOT 4
- Clarify the naming conventions for hooks
- How to use useHydration API? HOT 1
- [error] [nitro] Error: Could not load (Nuxt, Prisma) HOT 2
- Add support for calling server plugins directly from the client
- Github Pages preset does not run Sitemap Module HOT 2
- In [email protected] the definePageMeta function is broken HOT 6
- can't use @use "sass:math" in style HOT 1
- type checking error for globally imported vitest globals HOT 7
- Dynamically changing the keepalive include attribute will invalidate all cached pages HOT 1
- Unable to use fetch API on Azure Static web apps HOT 4
- Host header for local api hits should match the domain from the original request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.js.