Closed cxo-jutz closed 4 months ago
Would you be able to provide a reproduction? π
I am unsure about the why but at our project it seemed to be fixed by removing the second script tags with
<script lang="ts">
export default {
name: "TestPage",
};
</script>
We have some files which export GraphQL Fragments in the non-setup script tag, so removing it wasn't an option. Thankfully, simply moving definePageMeta
to the <script>
tag without setup
fixed the issue. Might be worth adding a note about that to the documentation, but leaving this here for anyone who finds the issue.
However, I am getting warnings like this:
definePageMeta() is a compiler-hint helper that is only usable inside the script block of a single file component which is also a page. Its arguments should be compiled away and passing it at runtime has no effect.
i updated nuxt to 3.13.0 Have same problem with definePageMeta
Please open a new issue with a reproduction if you are facing this. Several similar issues have been resolved, which is why this is closed.
@danielroe @fletcherhaz i use 3.12.4 and 3.13.0 and i have this problem, but when i install 3.11.2 - all okay okay i open new "issues"
Environment
Reproduction
Minimal example - here it seems to work as intended tho: https://codesandbox.io/p/sandbox/stoic-star-y6tk4z
In app.vue is simply
defined. And in pages is the layout (which is in /layouts (default.vue, test.vue) with definePageMeta
Describe the bug
Only since a few days without any recall of change regarding these files, we noticed that on the checkout and account pages it will always load the default layout now. If we add a console.log right underneath the definePageMeta it shows up, so the file itself etc is the correct, just the right layout isn't applied anymore.We tried updating the packages but even that didn't change the behavior, same with cache and a fresh dev start. I've also read through https://github.com/nuxt/nuxt/issues/13354 which seemed to be the same bug, but we have the NuxtPage wrapping the NuxtLayout in the app.vue.
Any clues/ ideas on which direction we could debug would be highly appreciated!
Additional context
No response
Logs
No response