Nuxt module define layout not working?
I recently updated my Nuxt project to version 3.12.1. In my Nuxt module, specifically in the playground page, I'm trying to define a custom layout. The layout file is available and it was working perfectly last week before the update.
Now, however, the custom layout isn't working and default layout is used. Did I miss any changes or updates in this new version? Any help or guidance would be appreciated, as I'm not sure what might be going wrong.
5 Replies
I also found out that when the module is used in a real nuxt 3 application. It also wont work. I also have another project from nuxt 3.11.2 and there it is working (logic is no diffrent)..
try to remove the import of definePageMeta (is autoimported by nuxt)e
Thanks but thats not it sadly. π₯²
My nuxt config has this off:
imports: {
autoImport: false,
},
But even when removing definePageMeta it wont work. It will get the default layout anyway.
@RedNova can you try like this
<script setup lang="ts">
definePageMeta({
layout: 'default'
})
</script>
Nope π¦ still giving me default layout.
I will try to downgrade to 3.12.0 if that is not working i will go back to 3.11.* Thanks for your help π
PS: not a single error in my console
OMG i fixed it.... Noob mistake i guess.
fix is run -> npx nuxi cleanup
And problem is back today :(.. tried to run npx nuxi cleanup. But this time it wont fix the issue.