Loki
December 16, 2022, 11:23am
1
opened 09:59AM - 29 Nov 22 UTC
closed 03:07PM - 20 Dec 22 UTC
bug
### 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:
<img width="998" alt="CleanShot 2022-11-29 at 10 55 39@2x" src="https://user-images.githubusercontent.com/4931832/204497556-af974b7c-e37b-4209-bb79-41949f91d18a.png">
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 🙏
Hi, the latest version of this library seems to be broken. I described the issue on Github, but I'm not sure it's the right place to do.
Can you take a look at it? Thanks!
Thanks for posting on GitHub @Loki ! That's awesome, and I can see you got it resolved
Loki
December 22, 2022, 3:05pm
5
Yes, the issue is fixed now, thanks to Lucie's help!