Cannot get the start point in the node at path [1] because it has no start text node.
See original GitHub issueDo you want to request a feature or report a bug?
Report a bug
What’s the current behavior?
Bug GIF:
https://codesandbox.io/s/slate-reproductions-cm3r7?file=/index.js
Slate: 0.57.1 Browser: Chrome OS: Mac
What’s the expected behavior?
The expected behavior is that the string can be parsed to Slate object without throwing an error.
I found that the bug is in this function
because the p
tag has no text, the children
parameter is an empty array, therefore the for
loop is never performed and returns the variable node
as an empty array.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Slate.js throws an error when inserting a new node at selected ...
The issue is related to rendering when you use useMemo , instead you should use useRef : const editorRef = useRef() if (!editorRef.current) ......
Read more >Fix "Problem updating node" errors in Zaps - Zapier Help
Fix "Problem updating node" errors in Zaps · 1. Try another browser · 2. Try another device · 3. Check your corporate network...
Read more >Error: Cannot resolve a DOM point from Slate point
Now fully understanding the issue, I set out to figure out how to move the cursor to the beginning of the input before...
Read more >Normalizing - Slate
This can happen if you check for a specific invalid structure, but then don't actually fix that structure with the change you make...
Read more >Nodes and Edges - PGF/TikZ Manual
Rather, they are added to the picture just before or after the path has been ... Thus, you can name a node just...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @lavaldi , the issue is that the paragraph blocks the deserialize function generates are allowed to have no children. This is an invalid state for slate; all blocks need to have at least one text node, even if it is empty. The deserializer function should be updated to correct that issue.
As for images, you should be able to pass a
void
flag to the image block to indicate that it is not intended to have text children. See the image example for how some examples of void blocks.If #4208 is merged, this will happen when
Editor.normalize
is used (for exampleEditor.normalize(editor, { force: true })
can be used to normalize an entire document).