-
-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate meta tags in Head when using vike-react-query with HTML Streaming #2261
Comments
Did not see it in the first place, they are even tripled in this example. The third one (which comes first on line 12) is my fault, forgot that tags from |
If the component that uses If the component is used only once, then it's probably due to some suspense boundary. It can be fixed on The best would be a reproduction. Alternatively, I couldn't reproduce. Keep me updated, also if you can't manage to reproduce nor create a PR — let's then re-evaluate how we can proceed. |
Btw. make sure to read https://vike.dev/Head#only-html as it answers your other questions. |
Description
I want to set page specific meta tags (title, description, keywords, etc.) on a page that uses html streaming with vike-react-query integration. I use component to set meta tags. I followed this example from vike-react-query docs.
After google indexing the pages I saw that description is somewhat autogenerated by google and not my code. I tried to investigate on that.
In dev mode and in prod I can see only page title being changed in dev tools html structrure and none in
view-source:
page content. Probably it is how it should work ifnon-bot
user accesses the page.Here is the real issue. I tested my page with googles rich results test and saw that all meta tags that were set in
Head
exist on this page, but duplicated.I set meta tags like this.
And here https://search.google.com/test/rich-results/result?id=M4CsddU7wJDBtVn4gJYf5A if you click on
view tested page
and then onedit code
you can see them being duplicated on line 47 and 48.Why it is important, it looks like that google ignores meta tags if they are duplicated and it is not valid html structrue.
I tried to create reproduction example, here is the code https://github.com/lgklsv/vike-streaming-meta-demo, but could not figure out how to deploy it on vercel (without deployment we can not see if meta tags are set properly and test it on how bots see the page). I used
vite-plugin-vercel
, which is like zero config, so I didnot change vercel output, but it showsServerless function has crashed
, then I triedModify Build and Output Settings > OUTPUT DIRECTORY from dist to dist/client.
and it still failed with the same message.Environment
The text was updated successfully, but these errors were encountered: