<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vchhabra55048</title>
    <description>The latest articles on DEV Community by Vchhabra55048 (@vchhabra55048).</description>
    <link>https://dev.to/vchhabra55048</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3954520%2F86345fd3-408e-49de-8240-b36beb0b8aa2.png</url>
      <title>DEV Community: Vchhabra55048</title>
      <link>https://dev.to/vchhabra55048</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vchhabra55048"/>
    <language>en</language>
    <item>
      <title>TipTap + Yjs + Hocuspocus saves content, but other users only see updates after a page refresh</title>
      <dc:creator>Vchhabra55048</dc:creator>
      <pubDate>Wed, 27 May 2026 14:41:38 +0000</pubDate>
      <link>https://dev.to/vchhabra55048/tiptap-yjs-hocuspocus-saves-content-but-other-users-only-see-updates-after-a-page-refresh-2o60</link>
      <guid>https://dev.to/vchhabra55048/tiptap-yjs-hocuspocus-saves-content-but-other-users-only-see-updates-after-a-page-refresh-2o60</guid>
      <description>&lt;p&gt;Hi everyone, I’m working on a Next.js app with a TipTap editor and I’m trying to enable real-time collaboration with Yjs and Hocuspocus.&lt;/p&gt;

&lt;p&gt;Current setup:&lt;/p&gt;

&lt;p&gt;Next.js app&lt;/p&gt;

&lt;p&gt;TipTap editor using useEditor() and EditorContent&lt;/p&gt;

&lt;p&gt;u/tiptap/extension-collaboration&lt;/p&gt;

&lt;p&gt;u/tiptap/extension-collaboration-cursor&lt;/p&gt;

&lt;p&gt;u/hocuspocus/provider on the frontend&lt;/p&gt;

&lt;p&gt;u/hocuspocus/server running separately&lt;/p&gt;

&lt;p&gt;Postgres stores normal TipTap JSON content&lt;/p&gt;

&lt;p&gt;Postgres also stores a base64 Yjs state&lt;/p&gt;

&lt;p&gt;Current behavior:&lt;/p&gt;

&lt;p&gt;User A edits a document section.&lt;/p&gt;

&lt;p&gt;The edit saves to the database correctly.&lt;/p&gt;

&lt;p&gt;User B can see the update only after refreshing the page.&lt;/p&gt;

&lt;p&gt;Without refreshing, User B’s editor does not update live.&lt;/p&gt;

&lt;p&gt;What we tried:&lt;/p&gt;

&lt;p&gt;Started the Hocuspocus server locally.&lt;/p&gt;

&lt;p&gt;Added the Hocuspocus WebSocket URL to the frontend.&lt;/p&gt;

&lt;p&gt;The editor can switch between normal TipTap mode and Yjs collaboration mode.&lt;/p&gt;

&lt;p&gt;When collaboration mode is forced, the editor reads from Yjs state instead of the normal TipTap JSON content.&lt;/p&gt;

&lt;p&gt;If the Yjs state is empty or stale, the document appears blank.&lt;/p&gt;

&lt;p&gt;Main question:&lt;/p&gt;

&lt;p&gt;What is the correct way to initialize a TipTap editor with existing saved TipTap JSON and then move it into Yjs/Hocuspocus collaboration mode without blanking the document?&lt;/p&gt;

&lt;p&gt;Specific questions:&lt;/p&gt;

&lt;p&gt;Should the existing TipTap JSON be converted into a Y.Doc before the editor is created?&lt;/p&gt;

&lt;p&gt;In collaboration mode, should the TipTap editor content option be undefined?&lt;/p&gt;

&lt;p&gt;What is the best practice for saving both Yjs state and normal TipTap JSON to a database?&lt;/p&gt;

&lt;p&gt;How can I verify that two users are connected to the same Hocuspocus document and receiving updates live?&lt;/p&gt;

&lt;p&gt;What are common reasons Hocuspocus/Yjs appears to save correctly but does not broadcast updates to other users?&lt;/p&gt;

&lt;p&gt;Any guidance on the correct TipTap + Yjs + Hocuspocus flow would be appreciated.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
