codex-team / codex-team/editor.js

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

Open
#1,669 6 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Describe a bug.

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

![image](https://user-images.githubusercontent.com/9000611/115541413-600e9400-a29f-11eb-9561-5e07ab74b81b.png)

Code looks as follows:

```
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](https://user-images.githubusercontent.com/9000611/115541413-600e9400-a29f-11eb-9561-5e07ab74b81b.png)

Device, Browser, OS:

Editor.js version: 2.20.2

Plugins you use with their versions:

react-editor-js: 1.9.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.