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
<Head> Rendering only on client side #9154
Comments
It's hard to say what's causing this because a clear and concise reproduction is missing (as asked for in the issue template). Please this 🙏 |
I'm getting this issue using As a workaround, you can create a function component which returns the meta tags you need, then call that component as a function and interpolate the result in your JSX instead of adding the component directly as a JSX tag. E.g.
|
I could make it work on dev and production when I removed a component that was as wrapper in the _app.js, when I removed it all started to work fine, thank for all the help |
@rodolphonetto, can you describe in more detail what this component was please, perhaps give an example? I've got no wrapper components around App (_app.tsx in my case). If you have to remove functionality to make this work, it sounds like you are doing a workaround. Why should adding a social meta tag mean that you cannot use this wrapper component? |
Well, to be honest Idk why it started to work... but here is the component I switched from de _app.js and put direct on the pages.
|
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
I tried to use something like
But it only changed the title on client side. The biggest problem is that I can't use og and twitter tags, then I can't create a card on twitter ou a facebook post that receives images and titles from my pages
A clear and concise description of what the bug is.
To Reproduce
just add some title and meta tags using the Head provied by Next
Then click to see the source code of the page, the tags are not there, but they are on the dev tools.
If I use Head on the _document.js the tags and title works fine on the source code, as it should do, but there I don't have the initialProps to make them dynamic.
Expected behavior
It should render on server side too as meta tags are used for third parties to get access into some properties of our pages.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Thanks for reading, and if it is not a bug, can someone explain how could I do that behavior?
The text was updated successfully, but these errors were encountered: