You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TypeScript Engine will report this problem on the <PortableText> components property:
Type '{ block: { h1: ({ children }: { children: any; }) => Element; }; }' is not assignable to type 'Partial<PortableTextReactComponents>'.
Types of property 'block' are incompatible.
Type '{ h1: ({ children }: { children: any; }) => Element; }' is not assignable to type 'PortableTextBlockComponent | Record<string, PortableTextBlockComponent>'.
Type '{ h1: ({ children }: { children: any; }) => Element; }' is not assignable to type 'Record<string, PortableTextBlockComponent>'.
Property 'h1' is incompatible with index signature.
Type '({ children }: { children: any; }) => Element' is not assignable to type 'PortableTextBlockComponent'.
Type '({ children }: { children: any; }) => Element' is not assignable to type 'FunctionComponent<PortableTextComponentProps<PortableTextBlock<PortableTextMarkDefinition, ArbitraryTypedObject | PortableTextSpan, string, string>>>'.
Types of parameters '__0' and 'props' are incompatible.
Type 'PropsWithChildren<PortableTextComponentProps<PortableTextBlock<PortableTextMarkDefinition, ArbitraryTypedObject | PortableTextSpan, string, string>>>' is not assignable to type '{ children: any; }'.
Property 'children' is optional in type 'PortableTextComponentProps<PortableTextBlock<PortableTextMarkDefinition, ArbitraryTypedObject | PortableTextSpan, string, string>> & { ...; }' but required in type '{ children: any; }'.ts(2322)
[types.ts(32, 3): ]()The expected type comes from property 'components' which is declared here on type 'IntrinsicAttributes & PortableTextProps<any>'
The front-end renders fine, but I'm trying to deploy this using NextJS / Vercel and the build is failing.
Note that the problem isn't occurring when using marks, or types.
The text was updated successfully, but these errors were encountered:
petervukovic
changed the title
Getting TypeScript Errors When using block component
Getting TypeScript errors When using block component
Apr 13, 2022
petervukovic
changed the title
Getting TypeScript errors When using block component
Getting TypeScript errors when using block component
Apr 13, 2022
Given this basic setup from the README:
The TypeScript Engine will report this problem on the
<PortableText>
components property:The front-end renders fine, but I'm trying to deploy this using NextJS / Vercel and the build is failing.
Note that the problem isn't occurring when using
marks
, ortypes
.The text was updated successfully, but these errors were encountered: