T
TanStack2mo ago
foreign-sapphire

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
foreign-sapphire
foreign-sapphireOP2mo ago
Could it be a START issue with hydration causing the duplicate scripts?
sensitive-blue
sensitive-blue2mo 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
rival-black
rival-black2mo ago
Any workaround for this?
foreign-sapphire
foreign-sapphireOP2mo ago

Did you find this page helpful?