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
because no SSR = No tags rendered on the server (except the fallback ones)
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?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) π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
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>
tagthats 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 π