{"record":{"id":"93f55443b1013b2f","repo":"facebook/lexical","slug":"listplugin-listnode-and-or-listitemnode-not-regis","errorCode":null,"errorMessage":"ListPlugin: ListNode and/or ListItemNode not registered on editor","messagePattern":"ListPlugin: ListNode and/or ListItemNode not registered on editor","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/lexical-react/src/LexicalListPlugin.ts","lineNumber":55,"sourceCode":"/**\n * Enables ordered, unordered, and check list support, registering the commands\n * and transforms that create and maintain {@link ListNode} and\n * {@link ListItemNode} structures. The editor must have both nodes registered.\n *\n * This is a legacy plugin. When building an editor with the extension API,\n * configure {@link ListExtension} instead.\n *\n * @returns `null`, this plugin renders no DOM of its own.\n */\nexport function ListPlugin({\n  hasStrictIndent = false,\n  shouldPreserveNumbering = false,\n}: ListPluginProps): null {\n  const [editor] = useLexicalComposerContext();\n\n  useEffect(() => {\n    if (!editor.hasNodes([ListNode, ListItemNode])) {\n      throw new Error(\n        'ListPlugin: ListNode and/or ListItemNode not registered on editor',\n      );\n    }\n  }, [editor]);\n\n  useEffect(() => {\n    return mergeRegister(\n      registerList(editor, {\n        restoreNumbering: shouldPreserveNumbering,\n      }),\n      hasStrictIndent ? registerListStrictIndentTransform(editor) : () => {},\n    );\n  }, [editor, hasStrictIndent, shouldPreserveNumbering]);\n\n  useList(editor);\n\n  return null;\n}","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/facebook/lexical/blob/76a22dcba981b46119fcec45f935270707e26a57/packages/lexical-react/src/LexicalListPlugin.ts#L37-L73","documentation":"ListPlugin requires both ListNode and ListItemNode to be registered on the editor, because its transforms and commands operate across list containers and their children. The plugin checks editor.hasNodes([ListNode, ListItemNode]) on mount and throws when either is absent. Lexical cannot handle node classes it was not configured with, so this is a fail-fast configuration check.","triggerScenarios":"Rendering <ListPlugin /> inside an editor created without ListNode or ListItemNode in the nodes array.","commonSituations":"Hand-assembling a nodes list and including only one of the two list nodes; copying list commands (insertUnorderedList) without registering nodes; moving off a preset bundle that previously registered both automatically.","solutions":["Add both ListNode and ListItemNode from @lexical/list to the editor's nodes array","Use the list extension with buildEditorFromExtensions to register both nodes","Verify with editor.hasNodes([ListNode, ListItemNode]) before mounting the plugin"],"exampleFix":"// before\nconst initialConfig = {nodes: [ParagraphNode, TextNode, ListNode]}; // ListItemNode missing\n<ListPlugin /> // throws\n\n// after\nimport {ListNode, ListItemNode} from '@lexical/list';\nconst initialConfig = {nodes: [ParagraphNode, TextNode, ListNode, ListItemNode]};\n<ListPlugin /> // ok","handlingStrategy":"validation","validationCode":"import {ListNode, ListItemNode} from '@lexical/list';\nif (!editor.hasNodes([ListNode, ListItemNode])) {\n  throw new Error('Add ListNode and ListItemNode to your editor nodes config before using ListPlugin');\n}","typeGuard":"function supportsLists(editor: LexicalEditor): boolean {\n  return editor.hasNodes([ListNode, ListItemNode]);\n}","tryCatchPattern":"try {\n  if (!editor.hasNodes([ListNode, ListItemNode])) throw new Error('List nodes missing');\n  // safe to use ListPlugin / list commands\n} catch (e) {\n  console.error('ListPlugin misconfigured:', e);\n}","preventionTips":["Always register ListNode and ListItemNode as a pair","Mount list commands and plugins only in the same component tree as node registration","Verify registration once at editor creation, not per keystroke"],"tags":["lexical","react","node-registration","list","plugin"],"backgroundTag":"missing-node-registration","analyzedSha":"76a22dcba981b46119fcec45f935270707e26a57","analyzedAt":"2026-08-31T21:45:54.792Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}