Good morning Payload! Today I noticed that when copying the word "Test" from one rich text editor to another, it would freeze editing and start logging some errors.
Payload Version: 1.7.2
Error:
Uncaught Error: Cannot resolve a Slate point from DOM point: [object
OH WAIT - it's happening even when just typing, not just on paste
Relevant Field config:
{
name: "positionSummaryText",
label: "Summary",
type: "richText",
required: false,
admin: {
elements: [
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"indent",
"link",
"ol",
"ul",
],
leaves: ["bold", "italic", "underline", "strikethrough"],
},
},
{
name: "responsibilities",
label: "Responsibilities",
type: "richText",
required: false,
admin: {
elements: [
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"indent",
"link",
"ol",
"ul",
],
leaves: ["bold", "italic", "underline", "strikethrough"],
},
},
{
name: "positionReqText",
label: "Requirements",
type: "richText",
required: false,
admin: {
elements: [
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"indent",
"link",
"ol",
"ul",
],
leaves: ["bold", "italic", "underline", "strikethrough"],
},
},
{
name: "positionSkillsText",
label: "Other Skills and Abilities",
type: "richText",
required: false,
admin: {
elements: [
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"indent",
"link",
"ol",
"ul",
],
leaves: ["bold", "italic", "underline", "strikethrough"],
},
},
Uncaught Error: Cannot get the start point in the node at path [] because it has no start text node.
AH FOUND IT
So....
If you have remnants of a fieldName, say it was an array
Even after clearing out the items, that's not sufficient if you wish to reuse the field name
Changing the field names to new names resolved the issue. Don't re-use field names on changed field types is the lesson here
Haha thanks Sean! Going forward I should clean the DB up if I do a field type change 😄
I was just going to ask some clarifying questions but you solved it all on your own, no surprise!
🏆
lessons learned!
Are you experincing this with Slate, or Lexical?
Hello ! Has this issue been addressed? We're having issues with the rich text editor as well where pasting doesn't work with a similar error messages. Has someone looked into it?
We have the same situation, no pasting and then not being able to type into the fields.
Here are our error messages:
Cannot get the start point in the node at path [] because it has no start text node.
Cannot read properties of undefined (reading 'children')
Cannot resolve a Slate point from DOM point: [object HTMLDivElement],0
I think I'm going to create an issue about it.
We're using Slate
I've just published an issue on GitHub:
https://github.com/payloadcms/payload/issues/7653We found the origin of the problem, and it is of our own making. Everything is resolved 👍
Star
Discord
online
Get dedicated engineering support directly from the Payload team.