Skip to content

vue-doctor/ecosystem/router-no-async-guard-without-next ​

An async beforeEach/beforeResolve guard that declares next must call it, otherwise navigation never resolves. Prefer returning a value and dropping next.

PropertyValue
CategoryEcosystem
Default Severitywarning
Confidencelow
FixableNo
Engineoxlint
Sincev1.1.0
Frameworksvue, nuxt

Why it matters ​

An async beforeEach/beforeResolve guard that declares next must call it, otherwise navigation never resolves. Prefer returning a value and dropping next.

How to fix ​

Review the finding and update the code according to best practices below.

Agent Guidance ​

In an async beforeEach/beforeResolve guard, either remove the next parameter and return true, false or a route location, or make sure next() is called exactly once on every code path.


Rule source: vue-doctor/ecosystem/router-no-async-guard-without-next

Released under the MIT License.