yjs / y-prosemirror

ProseMirror editor binding for Yjs
https://demos.yjs.dev/prosemirror/prosemirror.html
MIT License
355 stars 124 forks source link

Prosemirror document doesn't get populated with Yjs doc content (sync plugin) #106

Closed ronnyroeller closed 2 years ago

ronnyroeller commented 2 years ago

Checklist

Describe the bug I initialize a Yjs document with updates from the database, and then create a Prosemirror editor linked to this Yjs document (sync plugin). Doing so, the Prosemirror editor isn't populated with the content from the Yjs document.

Note: I'm running the code on the server-side (NodeJS) - not in a browser!

This issue was initially discussed in the Yjs Community forum.

To Reproduce Minimal reproduction case: https://github.com/ronnyroeller/y-prosemirror-update (see README for execution instructions)

It shows that the Prosemirror doc doesn't contain the content from the Yjs doc: image

Expected behavior Prosemirror editor contains content from the Yjs document.

Environment Information

dmonad commented 2 years ago

Looking through this again, it makes sense. y-prosemirror plugins operate on the view. So it's natural that it doesn't work if you don't have a view.

ronnyroeller commented 2 years ago

Thanks for the explanation, @dmonad Closing this ticket as it's expected behavior.