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

"field" attributes of the RichText breaking #53

Closed
loick opened this issue Nov 29, 2022 · 6 comments
Closed

"field" attributes of the RichText breaking #53

loick opened this issue Nov 29, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@loick
Copy link

loick commented Nov 29, 2022

Versions

  • @prismicio/types: 0.2.4
  • node: 16.13.1

Context

Hi everyone, I've been trying to update the last version of prismic-types, but I came across an issue on the RichText as you can see on the screenshot below:
CleanShot 2022-11-29 at 10 55 39@2x

This error only appears when I try to update this library, so I guess this is related.

Here is the full report from Typescript:

Type '[] | [RTNode, ...RTNode[]]' is not assignable to type '[] | [RTNode, ...RTNode[]] | null | undefined'.
  Type '[RTNode, ...RTNode[]]' is not assignable to type '[] | [RTNode, ...RTNode[]] | null | undefined'.
    Type '[import("{my_nodemodules_path}/@prismicio/types/dist/index").RTNode, ...import("{my_nodemodules_path}/@prismicio/types/dist/index").RTNode[]]' is not assignable to type '[import("{my_nodemodules_path}}/@prismicio/types/dist/index").RTNode, ...import("{my_nodemodules_path}}/@prismicio/types/dist/index").RTNode[]]'.
      Type at position 0 in source is not compatible with type at position 0 in target.
        Type 'import("{my_nodemodules_path}/@prismicio/types/dist/index").RTNode' is not assignable to type 'import("{my_nodemodules_path}}/@prismicio/types/dist/index").RTNode'.
          Type 'RTHeading1Node' is not assignable to type 'RTNode'.
            Type 'import("{my_nodemodules_path}/@prismicio/types/dist/index").RTHeading1Node' is not assignable to type 'import("{my_nodemodules_path}}/@prismicio/types/dist/index").RTHeading1Node'.
              Types of property 'spans' are incompatible.
                Type 'import("{my_nodemodules_path}/@prismicio/types/dist/index").RTInlineNode[]' is not assignable to type 'import("{my_nodemodules_path}}/@prismicio/types/dist/index").RTInlineNode[]'.
                  Type 'import("{my_nodemodules_path}/@prismicio/types/dist/index").RTInlineNode' is not assignable to type 'import("{my_nodemodules_path}}/@prismicio/types/dist/index").RTInlineNode'.
                    Type 'RTLinkNode' is not assignable to type 'RTInlineNode'.
                      Type 'import("{my_nodemodules_path}/@prismicio/types/dist/index").RTLinkNode' is not assignable to type 'import("{my_nodemodules_path}}/@prismicio/types/dist/index").RTLinkNode'.
                        Types of property 'data' are incompatible.
                          Type 'FilledContentRelationshipField<string, string, unknown> | FilledLinkToWebField | FilledLinkToMediaField' is not assignable to type 'FilledContentRelationshipField<string, string, never> | FilledLinkToWebField | FilledLinkToMediaField'.
                            Type 'FilledContentRelationshipField<string, string, unknown>' is not assignable to type 'FilledContentRelationshipField<string, string, never> | FilledLinkToWebField | FilledLinkToMediaField'.
                              Type 'FilledContentRelationshipField<string, string, unknown>' is not assignable to type 'FilledContentRelationshipField<string, string, never>'.
                                Types of property 'data' are incompatible.
                                  Type 'unknown' is not assignable to type 'undefined'.

Any idea what I'm missing here? Thanks 🙏

@loick loick added the bug Something isn't working label Nov 29, 2022
@github-actions
Copy link

This issue has been labeled as a bug since it was created using the 🚨 Bug Report Template.

Hi there, thank you so much for the report!

Following our Maintenance Process, we will review your bug report and get back to you next Wednesday. To ensure a smooth review of your issue and avoid unnecessary delays, please make sure your issue includes the following:

  • Information about your environment and packages you use (Node.js version, package names and their versions, etc.)
    Feel free to attach a copy of your package.json file.
  • Any troubleshooting steps you already went through
  • A minimal reproduction of the issue, and/or instructions on how to reproduce it

If you have identified the cause of the bug described in your report and know how to fix it, you're more than welcome to open a pull request addressing it. Check out our quick start guide for a simple contribution process.

If you think your issue is a question (not a bug) and would like quicker support, please close this issue and forward it to an appropriate section on our community forum: https://community.prismic.io

- The Prismic Open-Source Team

@loick
Copy link
Author

loick commented Dec 16, 2022

Is there any news on this?

@lihbr
Copy link
Member

lihbr commented Dec 16, 2022

Hey there,

We're really sorry for falling behind our predicted maintenance schedule and leaving you without any answer so far.

We've heard from various TypeScript issues related to the RichText field's type recently. We think it's due to a version mismatch between types shipped by packages because we bundled some of them inconsistently.

We'll try to get that fixed next week, and we'll keep you posted.

Thanks for your understanding.

@loick
Copy link
Author

loick commented Dec 19, 2022

Sure no pb, thanks @lihbr!

@lihbr
Copy link
Member

lihbr commented Dec 19, 2022

Hey @loick, we made some updates to our kits targeting that, could you try updating your dependencies and trying again? Hopefully we got it :)

@loick
Copy link
Author

loick commented Dec 20, 2022

It's working properly indeed, thanks for your help 🙏
Upgrading both the react & types package made it work:

The versions working together are:

"@prismicio/react": "2.5.1",
"@prismicio/types": "0.2.7",

@loick loick closed this as completed Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants