Node of richText is missing type #1141
-
Node of richText is missing typeexpected format is: { "children":[{"text":""}], type: "paragraph" } |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I believe this is intentional. Slate is schema-less, so each implementation of Slate defines its own schema. In the case of Payload CMS, In the docs for the rich text field, the serializer example renders the So I am guessing this is what you are expected to do? If the type is undefined, assume it's a paragraph! |
Beta Was this translation helpful? Give feedback.
I believe this is intentional. Slate is schema-less, so each implementation of Slate defines its own schema.
In the case of Payload CMS,
paragraph
is not set as a fallback for nodes with no type. This differs from the Slate demo, whereparagraph
is set on nodes.In the docs for the rich text field, the serializer example renders the
<p>
HTML element as the default - i.e. if no types are found. See https://github.com/payloadcms/payload/blob/master/docs/fields/rich-text.mdx.So I am guessing this is what you are expected to do? If the type is undefined, assume it's a paragraph!