TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.97k stars 391 forks source link

Real-time collaboration causes an infinite stream of updates when focusing the editor on a standard Next.js app #471

Closed rodobre closed 4 months ago

rodobre commented 7 months ago

Describe the bug When using a basic Next.js app, the real-time collaboration feature shown in the documentation causes an infinite stream of updates when focusing the editor, leading to constant flickering and re-renders.

To Reproduce https://github.com/rodobre/blocknote-collaboration-issue

Misc

Video:

https://cdn.discordapp.com/attachments/1015169282444894219/1182540721383821412/Screen_Recording_2023-12-08_at_05.31.10.mov?ex=658511de&is=65729cde&hm=5584f4d456219294547853f0f8fa4920f6df7120c0cb429ee0fb7e1212733eef&

Note:

This also happens on Webrtc with y-webrtc using the documentation code, the problem does not seem to be provider-related:

const provider = new WebrtcProvider("my-document-id", doc); // setup a yjs
rodobre commented 7 months ago

Related to this:

https://github.com/ueberdosis/tiptap/issues/4482

Bug only occurs in dev due to React strict mode. Feel free to close the issue if you think no fix can be done on BlockNote's end.

matthewlipski commented 7 months ago

Thanks for reporting this! Seems like the TipTap guys are still working on this, hopefully we see a fix from them relatively soon

YousefED commented 4 months ago

StrictMode + collab now works again in the new version! We improved our React architecture