N
Nuxt4mo ago
Brys

Can't use custom layout on index.vue for root page

I'm encountering an issue when applying a layout to my index.vue for my root / path. Seemingly, nuxt is ignoring the definePageMeta({layout: 'authenticated'}) and is still using the default.vue layout. Trying definePageMeta() on a different page from root works. What could be the issue here?
No description
10 Replies
Brys
BrysOP4mo ago
Heres what devtools is showing me, so vue/nuxt is still using the default layout
Brys
BrysOP4mo ago
but in the index.vue root page i am using definePageMeta({layout: 'authenticated'})
No description
Brys
BrysOP4mo ago
heres the dom view of the default layout still being applied.
No description
Brys
BrysOP4mo ago
heres what the dom should be loading
No description
Brys
BrysOP4mo ago
It works when I use the same definePageMeta on a different page though, for example /login the layout is correctly applied
No description
Brys
BrysOP4mo ago
the same implmentation in the page itself
No description
Brys
BrysOP4mo ago
and the dom correctly displays the authenticated layout is loading
No description
Brys
BrysOP4mo ago
It's probably something I'm doing, but if it was wouldn't no pages be able to load the authenticated/custom layout? Which is why I think it might be a bug.
Brys
BrysOP4mo ago
Heres my minimal reproduction on stackblitz: https://stackblitz.com/edit/github-vmev3n
Brys
StackBlitz
Nuxt - Starter - StackBlitz
Create a new Nuxt project, module, layer or start from a theme with our collection of starters.
Brys
BrysOP4mo ago
wait a minute, what now it works on stackblitz i wonder if its cache it is a cache issue clearing .nuxt and running nuxt dev again and it works least on stackblitz, still have an issue on my project yeah cant get it working still on mine, using setPageLayout like you are suppsoed to for dynamic layouts does work
Want results from more Discord servers?
Add your server