-
Notifications
You must be signed in to change notification settings - Fork 280
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
Hydration errors when using Script component with getSeoMeta #2273
Comments
I can also confirm on y side that there is a hydration error. Is there a fix? |
The error may be more related to the |
I spent some time trying to preproduce this and was unable to. Could you please provide a Github Repo or a more complete example? I recommend loading 3rd party scripts with |
Closing due to lack of feedback. |
Hi @blittle , we are still seeing this issue. I am not sure if you'd be keen to do a screen share to see it, or if there is another way I can help you reproducte the problem. Thanks. |
@lluisgassovillarejo the more specifics you can give with the problem narrowed down. Easiest would be to generate a new project via |
Thanks @blittle , Although I managed to replicate the error, it is prooving very elusive. I will update this if I come across it again. Otherwise, I think we can close this one. Apologies for the inconvenience. |
Make sure to use an incognito window when testing hydration errors, because browser extensions can erroneously cause them. |
Here is a repo based off gtm template. The only change is the addition of jsonLd. I also added my own GTM ID but that doesn't seem to matter. It immediately breaks in Chrome incognito The reason we use the same |
Note that something like this with useLoadScript makes me cautiously optimistic. useLoadScript(`https://www.googletagmanager.com/gtm.js?id=GTM-abc123`); I also wonder if this is related to general vite/remix meta issue as we're seeing this problem |
Could this be related to #2389? |
Same issue for us on Using
|
What is the location of your example repository?
https://github.com/stevenbister/hydrogen-hydration-errors
Which package or tool is having this issue?
Hydrogen
What version of that package or tool are you using?
2024.4.6
What version of Remix are you using?
2.9.2
Steps to Reproduce
Add the required secrets and add the GTM ID to the GTM script in the root.tsx and run the app with
npm run dev
.Open the dev tools and go to the console
Expected Behavior
I would expect there should be no errors logged in the console
Actual Behavior
When using
along with
in the demo store there is a hydration error caused that says
This error goes away if you remove the
jsonLd
property from the seo payload or remove the GTM script, ideally would be able to use both togetherThe text was updated successfully, but these errors were encountered: