Open ductuannguyen1999 opened 5 months ago
All of the components that use lexical have to be "use client" and you should try updating to the latest lexical. Also make sure that lexical and all @lexical/* dependencies are the exact same version.
All of the components that use lexical have to be "use client" and you should try updating to the latest lexical. Also make sure that lexical and all @lexical/* dependencies are the exact same version.
Hey @etrepum, thank you for your reply. I've tried adding "use client" to all my lexical components, and updated all lexical packages to the latest version. The collaboration seems to be working now with collaborators being able to edit on the same document. However, when I refresh the page, the updates disappeared. And after a few more updates, the updates restored. I'm using y-websocket server as the yjs provider for the collaboration plugin. This doesn't happen with the Next.js page router though. Would this have anything to do with the y-websocket server connection? What updates should I make to my Next.js app router page to fix this issue? I'm new to Next.js app router, so I apologize if there is any confusion in my question, and I would really appreciate your support :)
I couldn't say what's going wrong without seeing all of the code, but my guess is that it has to do with how you're setting up the provider for the collab plug-in.
My Lexical editor was working perfectly fine with Next.js page router. But after I updated my project to use Next.js App Router, the lexical editor's collaboration plugin was not working properly. Sometimes, the lexical changes are not synced between collaborators. I'm using y-websocket for the yjs Websocket provider. Does this has anything to do with how Next.js app router works?
Lexical version: ^0.14.5
Steps To Reproduce
My code in page router and app router are exactly the same, but the issue occurs with app router: App router test page: (which has issue)
Page router test page: (which works fine)
The current behavior
With the app router test page:
The expected behavior