N
Nuxt5mo ago
E♭

Unknown route middleware.

I have this middleware:
export default defineNuxtRouteMiddleware((to, from) => {
const { user } = useAuth();

if ( ! user) {
return navigateTo('/login');
}
})
export default defineNuxtRouteMiddleware((to, from) => {
const { user } = useAuth();

if ( ! user) {
return navigateTo('/login');
}
})
And I have this page:
<template>
<div>
<p>Authenticated users only!</p>
</div>
</template>

<script setup lang="ts">
definePageMeta({
middleware: ["auth"]
})
</script>
<template>
<div>
<p>Authenticated users only!</p>
</div>
</template>

<script setup lang="ts">
definePageMeta({
middleware: ["auth"]
})
</script>
And I receive the following error:
500 Unknown route middleware: 'abc'. Valid middleware: .
1 Reply
E♭
E♭OP5mo ago
Bump.
Want results from more Discord servers?
Add your server