团队协同bug,caught TypeError: Cannot read properties of undefined (reading 'nodeSize') #1075
Open
1 task done
Labels
bug
Something isn't working
Describe the bug
仿照官方文档"https://www.blocknotejs.org/docs/advanced/real-time-collaboration"中的示例
将"y-webrtc"修改为"y-websocket",其余部分不变。
用户a编辑文档A并且新建了多个block同时用户b进入文档A就会报这个错误。
如果用户a修改文档后把光标点击到第一个block上,用户b进入文档A就不会报这个错误。
我认为是光标的读取获取存在bug
To Reproduce
import * as Y from "yjs";
import { WebsocketProvider } from "y-websocket";
// ...
const doc = new Y.Doc();
const provider = new WebsocketProvider(
"wss://demos.yjs.dev", // 官方demo的WebSocket地址
"your-room-name", // 替换为您想要的房间名称
doc
);
const editor = useCreateBlockNote({
// ...
collaboration: {
// The Yjs Provider responsible for transporting updates:
provider,
// Where to store BlockNote data in the Y.Doc:
fragment: doc.getXmlFragment("document-store"),
// Information (name and color) for this user:
user: {
name: "My Username",
color: "#ff0000",
},
},
// ...
});
Misc
The text was updated successfully, but these errors were encountered: