@canadaduane - inside of y-websocket
inside setupWSConnection
, i modified this block:
const doc = map.setIfUndefined(docs, docName, () => {
const doc = new WSSharedDoc(docName)
doc.gc = gc
if (persistence !== null) {
persistence.bindState(docName, doc)
}
docs.set(docName, doc)
const content = 'testing123';
const ytext = new Y.Text();
ytext.insert(0, content);
const state = Y.encodeStateAsUpdate(ytext.doc);
Y.applyUpdate(doc, state);
return doc
})
but i’ve tried different variations, and when I start the server it looks good, but now when i get the document from the client the sever errors out:
running on port 1234
/Users/tcubbedge/my-y-websockets-server/node_modules/yjs/dist/yjs.cjs:797
writeClientsStructs(encoder, doc.store, targetStateVector);
^
TypeError: Cannot read property 'store' of null
at writeStateAsUpdate (/Users/tcubbedge/my-y-websockets-server/node_modules/yjs/dist/yjs.cjs:797:36)