N
Nuxtβ€’6mo ago
DANANZ M1

why nuxt ignores my head tags when using ssr:false?

I saw that this PR: https://github.com/nuxt/framework/pull/8975 should use the head tags for ssr:false pages but its not working in my case, its only taking fallbacks from the nuxt.config.ts file
GitHub
feat(nuxt, schema): official @vueuse/head v1 support by harlan-zw Β·...
πŸ”— Linked issue Remake of PR #8908 (comment) nuxt/nuxt#14172 ❓ Type of change πŸ“– Documentation (updates to the documentation or readme) 🐞 Bug fix (a non-breaking change that fixes an issue) πŸ‘Œ...
6 Replies
manniL
manniLβ€’6mo ago
because no SSR = No tags rendered on the server (except the fallback ones)
DANANZ M1
DANANZ M1OPβ€’6mo ago
so what the best practice to prerender spa pages for adding tags? I managed to prerender all pages, even the ones with ssr: false but how do I add meta tags?
manniL
manniLβ€’6mo ago
why would you use SSR false when you would want to prerender things? You better use ssr: true for the pages you want to prerender (either in the config or set via route rules) πŸ‘
DANANZ M1
DANANZ M1OPβ€’6mo ago
It's ssr false because we actually only need these pages in spa mode. I saw this pr and thought it's possible to pre-render meta tags without rendering the page component itself
manniL
manniLβ€’6mo ago
well, if you want the correct meta tags for previewing/og images, you need to prerender. You can still have everything on the page as client-only though if needed with a <ClientOnly> tag
DANANZ M1
DANANZ M1OPβ€’6mo ago
thats what I thought so.. it will require bigger changes, thats why I tried the approach that keeps ssr: false, But I guess theres no way to make it work so I'll probably switch to ClientOnly and earn a fallback template instead of the spaTemplate πŸ™‚
Want results from more Discord servers?
Add your server