diff --git a/packages/kit/src/pages.ts b/packages/kit/src/pages.ts index 9820fe64ff..3e36eb2c03 100644 --- a/packages/kit/src/pages.ts +++ b/packages/kit/src/pages.ts @@ -51,6 +51,7 @@ export function addRouteMiddleware (input: NuxtMiddleware | NuxtMiddleware[], op for (const middleware of middlewares) { const find = app.middleware.findIndex(item => item.name === middleware.name) if (find >= 0) { + if (app.middleware[find].path === middleware.path) { continue } if (options.override === true) { app.middleware[find] = middleware } else {