CollaborationCursor undefined doc runtime error

Hello, I am trying to get the collaboration cursor plugin to work. On adding it to the TipTap editor, it throws an undefined doc error at runtime. It seems the error has to do with the cursor-plugin. Here’s the stack trace. ‘doc’ refers to a Y.Doc.

What eludes me is that it works with the HocusPocus backend but I am trying to get it to work with the y-websocket provider.

Here’s my code for reference. Section and SectionManager are my own extensions.

const Editor = (props: IEditor) => {
  const socketProtocol = location.protocol === "https:" ? "wss:" : "ws:";
  const context = useContext(DocumentContext);
  const currentUser = useContext(UserContext);
  const documentOwner = context.owner;
  const wsProvider = new WebsocketProvider(
    `${socketProtocol}//` + + "/ws",
      disableBc: true 
  const editor = useEditor({
    autofocus: true,
    extensions: [
        history: false,
        document: doc,
        provider: wsProvider,

if (editor) { = documentOwner; = currentUser.username;

  return (
      {editor && <SectionToolbarButton editor={editor} />}
          marginTop: 10,
          marginLeft: 200,
          marginRight: 200,
        {props.debug && <pre>{JSON.stringify(editor?.getJSON(), null, 2)}</pre>}

export default Editor;

Would appreciate any help regarding the above, thanks!

Can you please post this in the TipTap editor forum? You posted a lot of custom code that is unrelated to code that I maintain. I can’t help you with that.

I thought the issue was with y-websocket/y-webrtc since it works fine with other providers (HocusPocus). But yes, understood, thank you.