How do I get nuxtApp.hook('app:created', (the app setup / store initialisations) to run before the m

How do I get nuxtApp.hook('app:created', (the app setup / store initialisations) to run before the middleware? Need some help here guys - very frustrating situation:
"nuxt": "^3.7.4",
"@pinia/nuxt": "^0.4.1",
"nuxt": "^3.7.4",
"@pinia/nuxt": "^0.4.1",
1 Reply
The Sheriff
The SheriffOP8mo ago
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 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;
}
Want results from more Discord servers?
Add your server