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

[Bug] Error thrown when modifying text, yes I know it's vague :(

Open vincentdesmares opened this issue 5 years ago • 4 comments

We got a report from Sentry that one of our user got a bug when modifying a text.

TypeError
Cannot read property 'inputs' of undefined
{snip} election){var e=this.Editor.BlockManager.getBlock(t.target).inputs;e.length>1&&!this.readyToBlockSelection?this.readyToBlockSelection=!0:1!= {snip}

I cannot reproduce it as I don't know how it got triggered.

Yet I know the last user action:

ui.click | div.ce-block__content > div.ce-paragraph.cdx-block

Browser : Chrome Version: 81.0.4044 Computer : Macbook pro with Mac OS X Version:10.14.6

Editor.js version and plugins you use with their versions:

"@editorjs/checklist": "^1.1.0",
"@editorjs/editorjs": "^2.17.0",
"@editorjs/embed": "^2.3.1",
"@editorjs/header": "^2.4.1",
"@editorjs/image": "^2.3.4",
"@editorjs/link": "^2.1.3",
"@editorjs/list": "^1.4.0",
"@editorjs/marker": "^1.2.2"

vincentdesmares avatar May 29 '20 12:05 vincentdesmares

Can you provide more details regarding the error?

ranemihir avatar Jun 19 '20 01:06 ranemihir

It seems this error is occured in blockSelection.ts. When multiple Editor.js instances are launched, this error can be occured by Ctrl + A (Select All Command),

hata6502 avatar Oct 15 '20 14:10 hata6502

Provide proper steps for reproducing the error. @vincentdesmares

ranemihir avatar Oct 15 '20 18:10 ranemihir

don't know what tooling you use when writing the code for the library, but as getBlock() might return undefined, you should not chain its call with property access/method call. i get the same error described by the author of this thread in handleCommandA() where you rely on getBlock() returning value based on event.target which is really unpredictable in general

sKopheK avatar Nov 06 '23 14:11 sKopheK