NUXT_E2004

Unknown route middleware.

E2004

A route middleware was referenced (usually via definePageMeta({ middleware: [...] })) but no middleware with that name exists. Common causes are a typo in the name, or a middleware file that was renamed or deleted without updating its references.

Resolution

Make sure the name matches a file in middleware/. Names are derived from the filename: middleware/auth.ts is referenced as auth.

Read more in Docs > Guide > Directory Structure > Middleware.
Was this helpful?