Back to Nuxt

NUXT_E2003

docs/errors/e2003.md

4.5.2400 B
Original Source

E2003

abortNavigation() was called outside a route middleware. It can only cancel navigation from within a middleware handler, so calling it from a component, plugin, composable, or a callback that lost the middleware context fails.

Resolution

Move the abortNavigation() call into the body of a defineNuxtRouteMiddleware() handler.

::read-more{to="/docs/api/utils/abort-navigation"} ::