You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug A clear and concise description of what the bug is.
Once the webpage is done rendering, the ``<script type="application/json+ld">...</script>``` templated through Helmet in Page component appears duplicated.
To Reproduce Steps to reproduce the behavior:
Get ftw-daily runinng in production mode (also works in dev mode but less obvious)
Open the devtools in your browser
Notice that <script type="application/json+ld">...</script> appears both at the bottom of the header and the bottom of the served page.
Expected behavior A clear and concise description of what you expected to happen.
<script type="application/json+ld">...</script> should only appear once, this causes issues with Google Rich Results testing tools and furthermore, with SEO.
Desktop (please complete the following information):
OS: macOS 10.15.6
Browser : Safari : 13.x / 14.0 / Chrome 84.0.x
Smartphone (please complete the following information):
Device: iPhone SE (1st gen)
OS: iOS 14 Developper Beta 4
Browser : Safari
Version : 14
Googlebot also encounters the issue !!!
** Similar issues **
Even though ftw-daily uses react-helmet-async, there seems to be a bug in the way Hemet templates script tags
@3wnbr1 thanks for reporting - this is an interesting problem.
Initial thoughts:
It seems that the initial script element (or should we say duplicate) comes from the server-side rendered version. So, it could be that this is not directly related to the issue mentioned in the react-helmet repo.
With SSR, all the "helmet-managed" scripts are pushed to the end of the body to reduce unnecessary load before any rendering happens. But I think "react-helmet" and "react-helmet-async" both want to deal with <head> in CSR mode.
I don't want to change the page-load behaviour, so the approach you suggested makes sense.
Anyway, I'll add a bug report to our internal tracker too.
Describe the bug A clear and concise description of what the bug is.
Once the webpage is done rendering, the ``<script type="application/json+ld">...</script>``` templated through Helmet in Page component appears duplicated.
To Reproduce Steps to reproduce the behavior:
<script type="application/json+ld">...</script>
appears both at the bottom of the header and the bottom of the served page.Expected behavior A clear and concise description of what you expected to happen.
<script type="application/json+ld">...</script>
should only appear once, this causes issues with Google Rich Results testing tools and furthermore, with SEO.Desktop (please complete the following information):
Smartphone (please complete the following information):
Googlebot also encounters the issue !!!
** Similar issues **
Even though ftw-daily uses
react-helmet-async
, there seems to be a bug in the way Hemet templates script tagsnfl/react-helmet#486
nfl/react-helmet#183 (comment)
Towards a fix*
Applying this patch mitigates the issue and therefore, json-ld metadata becomes valid for Google
The text was updated successfully, but these errors were encountered: