Comments (3)
Start a new pull request in StackBlitz Codeflow.
from nuxt.js.
The reason is that middleware also runs when trying to render the error page. Thus the error page can't render and it falls back to nitro error page.
You can whether you are rendering an error page by checking whether event.path
starts with /__nuxt_error
.
from nuxt.js.
Thanks a lot for the feedback! If anybody else runs into this, here is the minimal working solution:
// server/middleware/healthcheck.ts
export default defineEventHandler(async (event) => {
if (!event.path.startsWith('/__nuxt_error')) {
throw createError({ message: 'Error from middleware', statusCode: 422 });
}
});
from nuxt.js.
Related Issues (20)
- Cannot read properties of undefined (reading 'appMiddleware') HOT 2
- await $fetch with layoutTransition and pageTransition mounted executed twice In a different layout - nuxt 3 HOT 3
- on cloudflare_module build, favicon.ico hasn't images HOT 1
- Can't define Expose be used after the request? HOT 3
- cors headers appear as fixed values. HOT 1
- I don't think this is a bug. no-cors only supports content-types of application/x-www-form-urlencoded, multipart/form-data or text/plain. HOT 5
- `useId` hydration mismatch when used in a dynamic global component HOT 3
- No control over <head> in server components HOT 2
- "I want to pass in a user-defined function, but runtimeConfig cannot pass in functions and arrays." HOT 4
- Tailwindcss added at last is not applied HOT 5
- Disabling SSR prevents remaining CSS from loading HOT 5
- Error: Cannot find module punycode/ HOT 9
- Img @error not working HOT 2
- useHead undefined after initiating a regex (since monday) HOT 4
- keepalive not work HOT 1
- String vs object errors with `createError` and accessing server-thrown errors on client
- Tailwind css issue related to CSS specificity on dev server HOT 1
- keep alive caches are destroyed when visit keep alive excluded page HOT 3
- The package generated under the .output/server/node_modules file is a hyperlink. HOT 2
- 'text/html' is not a valid JavaScript MIME type. HOT 2
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.