Fix Yjs WebSocket in dev mode
- Add Vite plugin implementing y-protocols sync server for dev mode - Fix useYjs hook: move provider creation into useEffect to survive React StrictMode remounts - Fix WebSocket URL: use /sync as base (y-websocket appends room name) - Verified in browser: Connected status, Host badge, awareness working Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
49e9d589b1
commit
230094b956
5 changed files with 151 additions and 21 deletions
|
|
@ -2,9 +2,10 @@ import { reactRouter } from "@react-router/dev/vite";
|
|||
import tailwindcss from "@tailwindcss/vite";
|
||||
import { defineConfig } from "vite";
|
||||
import path from "node:path";
|
||||
import { yjsDevPlugin } from "./app/lib/vite-yjs-plugin";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tailwindcss(), reactRouter()],
|
||||
plugins: [tailwindcss(), reactRouter(), yjsDevPlugin()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"~": path.resolve(__dirname, "./app"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue