question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

editor.findPath is not a function

See original GitHub issue

Getting the error TypeError: editor.findPath is not a function even if the text is not empty.

Logging editor gives the following:

addMark: (key, value) => {…}
apply: op => {…}
children: (12) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
deleteBackward: unit => {…}
deleteForward: unit => {…}
deleteFragment: () => {…}
history: {undos: Array(1), redos: Array(0)}
insertBreak: () => {…}
insertData: data => {…}
insertFragment: fragment => {…}
insertNode: node => { Transforms.insertNodes(editor, node); }
insertText: text => {…}
isInline: () => false
isVoid: element => {…}
marks: null
normalizeNode: entry => {…}
onChange: () => {…}
operations: []
redo: () => {…}
removeMark: key => {…}
selection: {anchor: {…}, focus: {…}}
undo: () => {…}

So findPath is not defined anywhere.

A different issue mentioned needing a nonempty text child, but that still doesn’t fix it.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
thesunnycommented, Dec 30, 2019

Looks like the code wasn’t updated.

Should say

ReactEditor.findPath(editor, element)

I couldn’t start the edit URL process as it stopped editing when I clicked on the input so there might be other bugs.

If you can get it working, will accept a PR.

1reaction
Josh-McFarlincommented, Dec 31, 2019

Yep, my code now works. Thanks!

Will work on a PR.

Read more comments on GitHub >

github_iconTop 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 >
How to use the slate-react.ReactEditor.findPath function in ...
To help you get started, we've selected a few slate-react.ReactEditor.findPath examples, based on popular ways it is used in public projects.
Read more >
Slate React
Get the current editor object from the React context. A version of useSlate that does not re-render the context. Previously called useEditor ....
Read more >
3x5kv87jt - JavaScript - OneCompiler
Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one of the robust, feature-rich online compilers for...
Read more >
Discussion - Editor freezing when code runs - Unity Forum
The editor freezes when I call the "FindPath" function: using System. ... when an infinite loop runs, but I could not Identify the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found