editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

[Bug] Cannot read properties of undefined (reading 'holder')

Open applegrew opened this issue 2 years ago • 14 comments

Describe a bug.

Steps to reproduce:

  1. Go to https://codepen.io/applegrew/pen/RwMbqdo
  2. Open browser console and click within the black rectangle randomly. You will see the error mentioned here.
  3. Click on "Readonly" checkbox to uncheck it and you will see that clicking inside the box still results into this error.

Expected behavior: There should be no JS error.

Screenshots: Screenshot 2022-06-27 at 9 37 15 PM

Device, Browser, OS: Chrome on MacOS

Editor.js version: 2.25.0

Plugins you use with their versions: None

applegrew avatar Jun 27 '22 16:06 applegrew

same question when 'blocks' property is empty

7polo avatar Jul 09 '22 02:07 7polo

I'm running into what I think is the same issue.

MEBonham avatar Jul 11 '22 20:07 MEBonham

Use blocks: [{ type: "paragraph", data: {} }]

AlexRMU avatar Oct 29 '22 15:10 AlexRMU

I've got same error. any updates ?

berkaygurbuz avatar Nov 12 '22 20:11 berkaygurbuz

Any news?

dimuska139 avatar Nov 17 '22 21:11 dimuska139

Use

...
data: {
  time: (new Date()).getTime(),
  version: '2.25.0',
  blocks: [{
	type: 'paragraph',
	data: {
	  text: '<a></a>'
	}
  }]
}
...

644792799 avatar Dec 01 '22 07:12 644792799

I also reproduce with editor.blocks.renderFromHTML('<p></p>'); without the "readonly" switch, see this codepen:

https://codepen.io/antoine_ol/pen/BaGKaKE

Open the browser console and click anywhere in the page. You will see errors.

Add any content inside the <p> tag (e.g. <p>a</p>) and it will work. But it fails with empty paragraph content. It not only shows an error in the console, but also fails to render the editor, which is crashed.

antoineol avatar Jun 16 '23 10:06 antoineol

i have the same issue, any update ?

johannbuscail avatar Jul 09 '23 13:07 johannbuscail

same issue here, it is when i set the the data dynamically with the editor.render({...}) and in fact when it is empty it throw that same error

DarioRega avatar Jul 19 '23 10:07 DarioRega

same trouble here! also editor.render({...})

justynjozwiak avatar Jul 19 '23 10:07 justynjozwiak

I got this same issue and turns out it was because i had applied a tune to the paragraph component but the tune had not been registered (I commented it out while testing something else.)

devon2018 avatar Jul 22 '23 22:07 devon2018

When Bolcks is set to [], an error will also be reported

Lubin7792 avatar Aug 22 '23 02:08 Lubin7792

bumping 😭

backtrackjack avatar Sep 12 '23 05:09 backtrackjack

version 2.27.2 don't have this problem and need actualization node js to 18

fefeswa avatar Sep 12 '23 13:09 fefeswa