T
TanStack5mo ago
sensitive-blue

Duplicate Scripts loaded in Head

Raising a discord thread regarding: https://github.com/TanStack/router/issues/4585 When google SEO bot runs my website it is receiving 2 copies of the HEAD scripts. my __root
<html lang="en" className="dark" suppressHydrationWarning>
<head>
<HeadContent />
</head>
<html lang="en" className="dark" suppressHydrationWarning>
<head>
<HeadContent />
</head>
my route
head: ({ loaderData }) => {
return {
scripts: [
{
id: "ld+json",
type: "application/ld+json",
children: JSON.stringify({
"@context": "http://schema.org",
....
head: ({ loaderData }) => {
return {
scripts: [
{
id: "ld+json",
type: "application/ld+json",
children: JSON.stringify({
"@context": "http://schema.org",
....
GitHub
Using createRootRoute, Scripts, and HeadContent components ad...
Which project does this relate to? Start Describe the bug When using the Scripts component and defining scripts array inside createRootRoute, the same script gets added multiple times in the head t...
4 Replies
sensitive-blue
sensitive-blueOP5mo ago
Could it be a START issue with hydration causing the duplicate scripts?
sensitive-blue
sensitive-blue5mo ago
Yes I have this problem as well, I don't think it's a START issue as it is reproducible in the example/basic-file-based example that doesn't use START
wee-sapphire
wee-sapphire5mo ago
Any workaround for this?
sensitive-blue
sensitive-blueOP5mo ago

Did you find this page helpful?