Skip to content
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

V2_MetaFunction using script:ld+json twice results in same key warning #6953

Closed
1 task done
wilcoschoneveld opened this issue Jul 25, 2023 · 4 comments · Fixed by #6954
Closed
1 task done

V2_MetaFunction using script:ld+json twice results in same key warning #6953

wilcoschoneveld opened this issue Jul 25, 2023 · 4 comments · Fixed by #6954
Assignees
Labels
bug Something isn't working renderer:react

Comments

@wilcoschoneveld
Copy link
Contributor

What version of Remix are you using?

1.18.1

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

export const meta: V2_MetaFunction = () => {
  return [
    {
      "script:ld+json": {
        "@context": "https://schema.org",
        "@type": "Product",
        ...
      },
    },
    {
      "script:ld+json": {
        "@context": "https://schema.org",
        "@type": "FAQPage",
        ...
      },
    },
  ];
};

Expected Behavior

Should add two <script type="application/ld+json"> tags without warning

Actual Behavior

Adds two <script type="application/ld+json"> tags with warning:

image

Culprit:
https://github.com/remix-run/remix/blob/97d82db0556ba8b40518898a75d6838e0bf3ced1/packages/remix-react/components.tsx#L834C36-L834C36

@kiliman
Copy link
Collaborator

kiliman commented Jul 25, 2023

Yes, it looks like the key should include the JSON-encoded value

<script 
  key={`script:ld+json:${json}`}
  type="application/ld+json"
  dangerouslySetInnerHTML={{ __html: json }}
/>

@brophdawg11 brophdawg11 added this to v2 Aug 3, 2023
@brophdawg11 brophdawg11 self-assigned this Aug 3, 2023
@brophdawg11 brophdawg11 moved this to Backlog in v2 Aug 3, 2023
@brophdawg11 brophdawg11 added bug Something isn't working and removed bug:unverified labels Aug 7, 2023
@brophdawg11 brophdawg11 moved this from Backlog to PR in v2 Aug 7, 2023
@brophdawg11 brophdawg11 added the awaiting release This issue has been fixed and will be released soon label Aug 8, 2023
@brophdawg11
Copy link
Contributor

This is resolved by #6954 and should be available once v2 is released.

@brophdawg11 brophdawg11 moved this from PR to Merged in v2 Aug 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-a179aa7-20230809 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@brophdawg11 brophdawg11 removed their assignment Aug 9, 2023
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-b1149bb-20230810 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@brophdawg11 brophdawg11 self-assigned this Aug 10, 2023
@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working renderer:react
Projects
No open projects
Status: Merged
Development

Successfully merging a pull request may close this issue.

3 participants