After updating to the newest Prismic, Slicemachine and Next.js version, I get a new error in my richtext serializer.
As described on the following page, I have a custom serializer for my rich text components:
import type { JSXMapSerializer } from '@prismicio/react';
import { PrismicNextImage } from '@prismicio/next';
import { Title, Text, ImageWrapper } from 'ui/components';
export const richTextComponents: JSXMapSerializer = {
heading1: ({ children, key }) => (
<Title level="h1" key={key}>
{children}
</Title>
),
paragraph: ({ children, key }) => <Text key={key}>{children}</Text>,
image: ({ node, key }) => {
return (
<ImageWrapper animation="curtain" slideIn="bottom" key={key}>
<PrismicNextImage
field={node}
sizes="(max-width: 1280px) 100vw, 1280px"
fallbackAlt=""
/>
</ImageWrapper>
);
},
};
For the field={node}
prop at <PrismicNextImage />
I newly get the following error:
Type 'RTImageNode' is not assignable to type 'ImageFieldImage | null | undefined'.
Type 'RTImageNode' is missing the following properties from type 'FilledImageFieldImage': id, edit
How can I fix this?
I would be happy to use <PrismicNextImage />
in here to have image usage streamlined trough the application.