Open richgcook opened 1 month ago
Hi, definePageMeta
only supports static values as it's a compile-time macro. You can learn more here: https://nuxt.com/docs/api/utils/define-page-meta
You should follow the docs for overrides to use dynamic data.
@harlan-zw are you able to provide an example of usage, i'm running into a simialr issue and using useBreadcrumbItems({ overrides: [] }); in setup() or created() has no affect
@harlan-zw are you able to provide an example of usage, i'm running into a simialr issue and using useBreadcrumbItems({ overrides: [] }); in setup() or created() has no affect
I think i've answered my own question, but there is no global way to affect the usage of useBreadcrumbItems() before the page renders afaik.
If you're able to make a reproduction of the issue I'll be able to provide a solution for you
https://github.com/mavrick/nuxt-seo-test
folder structure: /pages/[gameId]/events/[eventId]/
http://localhost:3000/cs/events/test/
[
{
"to": "/",
"label": "Home",
"ariaLabel": "Home",
"current": false
},
{
"to": "/cs",
"label": "Counter Strike",
"ariaLabel": "Counter Strike",
"current": false
},
{
"to": "/cs/events",
"label": "Gameid Events Eventid",
"ariaLabel": "Gameid Events Eventid",
"current": false
},
{
"to": "/cs/events/test",
"label": "Gameid Events Eventid",
"ariaLabel": "Gameid Events Eventid",
"current": true
}
]
"@nuxtjs/seo": "2.0.0-rc.23",
Details
Being able to override specific page labels in the breadcrumb using definePageMeta is great but I'm unable to use dynamic values consistently in definePageMeta even though it works in useHead without problems but randomly, not all the time, I get a 500 server error
title is not defined
An extract of my code below to demonstrate the setup but is there any reason why using title.value, which works consistently in useHead, would error out when used in definePageMeta?