-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Using server middlewares breaks both dev and build servers #13539
Comments
I believe the key is Not sure if The |
Workaround for now is: import { defineNuxtConfig } from 'nuxt3';
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
serverMiddleware: [
{
- path: '/_/health',
+ route: '/_/health',
- handler: '~/server/health.ts',
+ handle: '~/server/health.ts',
},
],
}); |
Environment
Darwin
v16.14.0
3.0.0-27460489.53fbca7
yarn@1.22.17
vite
typescript
,build
,vite
,css
,buildModules
,unocss
,fifteenSitemap
,serverMiddleware
,meta
,publicRuntimeConfig
-
@unocss/nuxt@0.22.7
,@vueuse/nuxt@7.5.3
,./modules/nuxt/i18n
,./modules/nuxt/sitemap
,./modules/nuxt/version
Reproduction
https://stackblitz.com/edit/github-kc5f98
Describe the bug
When a
serverMiddleware
array is defined innuxt.config.ts
, Nuxt throws an error at start (in dev or build mode).I will update this issue when I find the commit which introduced this apparent bug.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: