{"record":{"id":"cf7165add8240c1c","repo":"payloadcms/payload","slug":"richtext-field-field-name-is-missing-the-edit","errorCode":null,"errorMessage":"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.","messagePattern":"RichText field \"(.+?)\" is missing the editor prop\\. For sub-richText fields, the editor props is required, as it would otherwise create infinite recursion\\.","errorType":"exception","errorClass":"MissingEditorProp","httpStatus":500,"severity":"error","filePath":"packages/payload/src/fields/config/sanitize.ts","lineNumber":401,"sourceCode":"    setDefaultBeforeDuplicate(field, parentIsLocalized)\n  }\n\n  if (!field.admin) {\n    field.admin = {}\n  }\n\n  if ('virtual' in field && field.virtual && field.admin.readOnly !== false && fieldAffectsData) {\n    field.admin.readOnly = true\n  }\n\n  // Make sure that the richText field has an editor\n  if (field.type === 'richText') {\n    const sanitizeRichText: RichTextSanitizer = (sanitizedConfig) => {\n      if (!field.editor) {\n        if (sanitizedConfig.editor && !requireFieldLevelRichTextEditor) {\n          field.editor = sanitizedConfig.editor\n        } else {\n          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\n        }\n      }\n\n      if (typeof field.editor === 'function') {\n        field.editor = field.editor({\n          config: sanitizedConfig,\n          isRoot: requireFieldLevelRichTextEditor,\n          parentIsLocalized: (parentIsLocalized || field.localized)!,\n        })\n      }\n    }\n\n    if (richTextSanitizers) {\n      richTextSanitizers.push(sanitizeRichText)\n    } else {\n      sanitizeRichText(config as unknown as SanitizedConfig)\n    }\n  }","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/payloadcms/payload/blob/00c58b35c0ed348ddc22daabf467b139727214fd/packages/payload/src/fields/config/sanitize.ts#L383-L419","documentation":"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.","triggerScenarios":"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`.","commonSituations":"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.","solutions":["Install a Payload rich-text editor package (e.g. `@payloadcms/richtext-lexical`) and pass it to `config.editor`.","For nested richText where the root editor is unsuitable, set `editor` directly on the field.","If you intentionally disabled editors project-wide, remove the richText fields."],"exampleFix":"// before\n// config has no editor, block has richText\nblocks: [{ slug: 'Content', fields: [\n  { name: 'body', type: 'richText' }\n]}]\n// after\n// 1) set root editor\nimport { LexicalEditor } from '@payloadcms/richtext-lexical'\nbuildConfig({ editor: LexicalEditor(), ... })\n// 2) or per-field\n{ name: 'body', type: 'richText', editor: LexicalEditor() }","handlingStrategy":"validation","validationCode":"function findRichTextWithoutEditor(fields, hasRootEditor) {\n  const bad = []\n  function walk(list, nested) {\n    for (const f of list) {\n      if (f?.type === 'richText' && !f.editor && (nested || !hasRootEditor)) bad.push(f.name)\n      if (Array.isArray(f?.fields)) walk(f.fields, true)\n      if (Array.isArray(f?.blocks)) for (const b of f.blocks) if (b?.fields) walk(b.fields, true)\n    }\n  }\n  walk(fields, false)\n  return bad\n}","typeGuard":"function richTextHasEditor(f: any, rootEditorAvailable: boolean): boolean {\n  return f?.type !== 'richText' || Boolean(f.editor) || rootEditorAvailable\n}","tryCatchPattern":"try {\n  await payload.init({ config })\n} catch (err) {\n  if (err?.name === 'MissingEditorProp' || /editor prop/i.test(err?.message ?? '')) {\n    console.error('richText field missing editor:', err?.data)\n  }\n  throw err\n}","preventionTips":["Always set `config.editor` to a Payload rich-text editor at the root config.","Set an explicit `editor` on richText fields inside blocks to avoid relying on root resolution."],"tags":["richtext","editor","config","sanitization","lexical","block"],"backgroundTag":null,"analyzedSha":"00c58b35c0ed348ddc22daabf467b139727214fd","analyzedAt":"2026-08-12T20:45:03.758Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}