#Code block error

4 messages · Page 1 of 1 (latest)

spice pasture
#

Any idea why I get this error: Collection "posts" > Field "content" > "value" does not match any of the allowed types
When adding this block to a block field in a collection:

import { Block } from "payload/types";

const CodeBlock: Block = {
  slug: "Code",
  fields: [
    {
      name: "content",
      type: "code",
      required: true,
      admin: { editorOptions: { minimap: false } },
    },
  ],
};

export default CodeBlock;
chilly pebble
#

Can we check out the posts collection defenition too?

paper hollow
#

Hey @spice pasture - were you able to figure out what was happening here? Would love to get to the bottom of this 👍

spice pasture
#

Hi @paper hollow , it looks like it's the editorOptions which is causing the error even if its empty> Removing it solves the issue