help, editor.api.html.deserialize(htmlContent) is error: TypeError: Cannot read properties of undefined (reading 'cloneNode') #4661
Replies: 3 comments 1 reply
-
Hi @shuangjiaobanmian! I'm Dosu and I’m helping the plate team. This error usually means the input to To fix this, make sure you pass a valid HTML string or an actual DOM element. If you have an HTML string, you can pass it directly: const nodes = editor.api.html.deserialize('<p>Hello, world!</p>'); If you already have a DOM node, pass it as Also, if you are using Plate with React, make sure to wire up DOM node support after creating your editor: import { ReactEditor } from 'slate-react';
editor.api.toDOMNode = ReactEditor.toDOMNode; This prevents related DOM errors details. Finally, always check that your input is not If you still see the error, log To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
One(success-html.html) is generated by export from Plate, and the other is not. But even if it's not an HTML generated by Plate.js, it shouldn't throw an error. It might be a bug. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
my-html-importer.tsx

Beta Was this translation helpful? Give feedback.
All reactions