codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.52k stars 2.08k forks source link

[Bug] Cannot read property 'holder'/'tool' of undefined #1669

Open fkocovski opened 3 years ago

fkocovski commented 3 years ago

Describe a bug.

Steps to reproduce: When trying to manually render data, I keep getting the following error:

image

Code looks as follows:

<EditorJs
        onReady={(instance) => instance.render({ blocks: [] })}
        tools={EDITOR_JS_TOOLS}
        instanceRef={(instance) => (editor.current = instance)}
      />

Also tried the useEffect approach like this:

 useEffect(() => {
    if (editor.current && description) {
      editor.current.isReady.then(() => {
        editor.current.render({ blocks: description.blocks });
      });
    }
  }, [editor.current, description]);

Please note: with 2.19.3 only the first error appears Uncaught TypeError: Cannot read property 'holder' of undefined but afterwards it is possible to focus the editor

Expected behavior:

Screenshots:

image

Device, Browser, OS:

Editor.js version: 2.20.2

Plugins you use with their versions:

react-editor-js: 1.9.0

wisnuwijo commented 3 years ago

Is there any update? I have the same problem

hyun-park commented 3 years ago

Same here.

paperbun commented 3 years ago

I am also facing the same issue.

After removing the all blocks using CTRL+Z and clicking on the editor, I am facing this issue

danlynkew commented 3 years ago

I have this issue also. Eagerly awaiting a solution.

danpalmieri commented 3 years ago

Same here!

bmknaidu555 commented 3 years ago

@danlynkew & @danpalmieri. I just wanted to know in which case you are getting this issue. In my case, I am getting this error while using the "editor-js undo" plugin. After I uninstalling that plugin this error is gone.