TypeError: nextytext.toDelta is not a function or its return value is not iterable
danny-hunt opened this issue · 2 comments
Crash caused by upgrading to 1.2.11
Checklist
- Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/
- Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/
Describe the bug
TypeError: nextytext.toDelta is not a function or its return value is not iterable
shows on performing a specific action in the editor.
This caught error escalates to a crash on other actions (eg changing page)
I added some console logging in sync-plugin.js on my machine (logging out the type & nextytext):
And get these logs - showing an instance where nextytext does not have a toDelta function.
The command function here is the one that triggers the error for me. There must be more than one user collaborating at the same time for the bug to occur
I've patched the error locally via
To Reproduce
Apologies that I don't have a simple example case for this
Steps to reproduce the behavior:
- Two users in collaboration
- Open console
- Perform action that results in a nextytext that does not have a toDelta function (eg a YXmlElement)
- See error
Expected behavior
Would not expect a strict requirement for nextytext to have a toDelta function
Screenshots
Added above
Environment Information
- node v22.4.0
- chrome 127.0.6533.99 (Official Build) (arm64) (but it occurs across many setups
- yjs 13.6.18
- y-indexeddb 9.0.12
- y-partykit 0.0.31
- y-protocols 1.0.6
- @syncedstore/yjs-reactive-bindings@0.6.0
Additional context
- I'm a sponsor 💖
- This issue is a blocker for my project.
I am also getting this issue when trying to copy an editor's contents to another using this:
xml2.insert(
0,
xml1
.toArray()
.filter((item) => !(item instanceof XmlHook))
.map((item) => item.clone()),
);