Closed chz closed 3 years ago
You can just remove defineNuxtMiddleware
type helper. Nuxt 3 does not support middleware like nuxt 2 (at least at the moment) and #app
is a nuxt3 compatible interface.
export default ({ app, store, redirect }) => {
if (store.state.auth.loggedIn) {
return redirect(app.localePath('account-id-card'))
}
}
For type support:
import type { Middleware } from '@nuxt/types'
export default <Middleware> function ({ app, store, redirect }) {
}
BTW We needed better messages and docs sorry for inconviences. Tracking in nuxt/bridge#209
Environment
Describe the bug
Reproduction
Just create middleware or use any middleware and refactor to new syntax ex.:
If i will import like this it will be work:
But there is another warn:
[bridge] [legacy capi]
@nuxtjs/composition-apiis deprecated. Please see https://v3.nuxtjs.org for more information.
Additional context
No response
Logs
No response