quill
quill copied to clipboard
TypeError: Cannot read properties of undefined (reading 'composing')
Greetings! I didn't manage to find a solution to this issue on my own, so I decided to report it separately to hopefully get an answer. App unexpectedly crashes with this error stack (acquired it using Sentry on production), seemingly at random:
TypeError: Cannot read properties of undefined (reading 'composing') at <object>.value(whiteboard-next/./node_modules/quill/dist/quill.js:5060:26) at <object>.value(whiteboard-next/./node_modules/quill/dist/quill.js:5116:26) at forEach(whiteboard-next/./node_modules/quill/dist/quill.js:7251:18) at Array.forEach(<anonymous>) at ScrollBlot.prototype.update(whiteboard-next/./node_modules/quill/dist/quill.js:7244:14) at <object>.value(whiteboard-next/./node_modules/quill/dist/quill.js:4331:99) at _this.observer(whiteboard-next/./node_modules/quill/dist/quill.js:7118:19)
I was unable to figure out the conditions under which the crash occurs, though I assume it's to do with text selecting/range. Please let me know if I can provide additional info to help resolve this.
-
quilljs
version: 1.3.7 - Browser & Version: Chrome (102, 109, 117), Yandex Browser.
- OS & Version: macOS (Catalina, Sonoma), Windows 10, Linux.
Please test with v2.0.0-beta.2
I did see the exception in Sentry with 2.0 beta but haven't found a way to reproduce.
Faced the same error (with Vue 3.x SPA app) and the cause was <span class="ql-cursor">(.+)</span>
in the content.
I've changed this.$refs.myQuillEditor.getContents()
to this.$refs.myQuillEditor.getContents()?.replace(/<span class="ql-cursor">(.+)<\/span>/g, '$1')
to avoid this error