payloadcms/payload · error · MissingEditorProp

RichText field "${field.name}" is missing the editor prop. F

Error message

RichText field "${field.name}" is missing the editor prop. For sub-richText fields, the editor props is required, as it would otherwise create infinite recursion.

What it means

A `richText` field has no `editor` prop, and Payload cannot supply one: either there is no `config.editor` set globally, or `requireFieldLevelRichTextEditor` is true (the sub-richText case). Payload requires an editor on sub-fields because deferring to the root editor would cause infinite recursion.

Source

Thrown at packages/payload/src/fields/config/sanitize.ts:401

    setDefaultBeforeDuplicate(field, parentIsLocalized)
  }

  if (!field.admin) {
    field.admin = {}
  }

  if ('virtual' in field && field.virtual && field.admin.readOnly !== false && fieldAffectsData) {
    field.admin.readOnly = true
  }

  // Make sure that the richText field has an editor
  if (field.type === 'richText') {
    const sanitizeRichText: RichTextSanitizer = (sanitizedConfig) => {
      if (!field.editor) {
        if (sanitizedConfig.editor && !requireFieldLevelRichTextEditor) {
          field.editor = sanitizedConfig.editor
        } else {
          throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor
        }
      }

      if (typeof field.editor === 'function') {
        field.editor = field.editor({
          config: sanitizedConfig,
          isRoot: requireFieldLevelRichTextEditor,
          parentIsLocalized: (parentIsLocalized || field.localized)!,
        })
      }
    }

    if (richTextSanitizers) {
      richTextSanitizers.push(sanitizeRichText)
    } else {
      sanitizeRichText(config as unknown as SanitizedConfig)
    }
  }

View on GitHub (pinned to 00c58b35c0)

Solutions

  1. Install a Payload rich-text editor package (e.g. `@payloadcms/richtext-lexical`) and pass it to `config.editor`.
  2. For nested richText where the root editor is unsuitable, set `editor` directly on the field.
  3. If you intentionally disabled editors project-wide, remove the richText fields.

Example fix

// before
// config has no editor, block has richText
blocks: [{ slug: 'Content', fields: [
  { name: 'body', type: 'richText' }
]}]
// after
// 1) set root editor
import { LexicalEditor } from '@payloadcms/richtext-lexical'
buildConfig({ editor: LexicalEditor(), ... })
// 2) or per-field
{ name: 'body', type: 'richText', editor: LexicalEditor() }
Defensive patterns

Strategy: validation

Validate before calling

function findRichTextWithoutEditor(fields, hasRootEditor) {
  const bad = []
  function walk(list, nested) {
    for (const f of list) {
      if (f?.type === 'richText' && !f.editor && (nested || !hasRootEditor)) bad.push(f.name)
      if (Array.isArray(f?.fields)) walk(f.fields, true)
      if (Array.isArray(f?.blocks)) for (const b of f.blocks) if (b?.fields) walk(b.fields, true)
    }
  }
  walk(fields, false)
  return bad
}

Type guard

function richTextHasEditor(f: any, rootEditorAvailable: boolean): boolean {
  return f?.type !== 'richText' || Boolean(f.editor) || rootEditorAvailable
}

Try / catch

try {
  await payload.init({ config })
} catch (err) {
  if (err?.name === 'MissingEditorProp' || /editor prop/i.test(err?.message ?? '')) {
    console.error('richText field missing editor:', err?.data)
  }
  throw err
}

Prevention

When it happens

Trigger: A richText field inside a block, array, group, or named tab with no per-field `editor` and no `config.editor`; any richText field when no `@payloadcms/richtext-lexical` (or slate) editor is wired into `config.editor`.

Common situations: Installing Payload without adding the rich-text editor to the config; using richText in a block while only configuring the editor at the root; upgrading where the editor must now be explicit.

Related errors


AI-assisted analysis of payloadcms/payload@00c58b35c0 (2026-08-12). Data as JSON: /api/errors/cf7165add8240c1c. Report an issue: GitHub.