The Sheriff
The Sheriff
NNuxt
Created by The Sheriff on 5/1/2024 in #❓・help
How do I get nuxtApp.hook('app:created', (the app setup / store initialisations) to run before the m
It even doesn't work if I add the middleware directly to the page
definePageMeta({
middleware: defineNuxtRouteMiddleware(async(to, from) => {
definePageMeta({
middleware: defineNuxtRouteMiddleware(async(to, from) => {
And I've even added code to control when it runs
const nuxtApp = useNuxtApp();
if (process.client && nuxtApp.isHydrating && nuxtApp.payload.serverRendered) {
console.log('hydrating');
return;
}
const nuxtApp = useNuxtApp();
if (process.client && nuxtApp.isHydrating && nuxtApp.payload.serverRendered) {
console.log('hydrating');
return;
}
3 replies
NNuxt
Created by The Sheriff on 5/1/2024 in #❓・help
How do I get nuxtApp.hook('app:created', (the app setup / store initialisations) to run before the m
I've tried changing the naming / order ot the plugins / middleware but no dice. Even tried using addRouteMiddleware in the plugin where I'm calling nuxtApp.hook('app:created', but the app setup still runs after the middleware
3 replies