Json ld : duplication error #71407
Unanswered
dhapdhap123
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to add jsonLd datas for both pages, "/blog" and "/blog/[searchKeyword]".
but I met some problems about this process.
blog > layout.tsx
return ( <> <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} id="jsonLd-blog" /> {children} </> );blog/[searchKeyword] > layout.tsx
return ( <> <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} id={jsonLd-${params.searchKeyword}} /> {children} </> );Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.I cannot know how to solve this problem. Next.js is the greatest framework for SEO I've used, but this error make me frustrated.. I need your help.
I want get rid of the parent's jsonLd script tag, without any error message like 'Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
Beta Was this translation helpful? Give feedback.
All reactions