Skip to content

fix(ui): avoid Vite HMR websocket collision#177

Open
LiuShenXi wants to merge 1 commit into
OpenBMB:mainfrom
LiuShenXi:fix/vite-hmr-chat-ws-collision
Open

fix(ui): avoid Vite HMR websocket collision#177
LiuShenXi wants to merge 1 commit into
OpenBMB:mainfrom
LiuShenXi:fix/vite-hmr-chat-ws-collision

Conversation

@LiuShenXi

Copy link
Copy Markdown

Summary

  • Configure Vite HMR to use a dedicated /__vite_hmr path.
  • Avoid collisions with PilotDeck's chat WebSocket proxy on /ws during local dev.

Problem

In local dev mode, the app chat socket also uses /ws. When Vite HMR traffic reaches the PilotDeck chat WebSocket handler, the server can receive a plain ping frame and try to parse it as JSON, producing an error like:

[ERROR] Chat WebSocket error: Unexpected token 'p', "ping" is not valid JSON

After that, the browser UI can remain stuck in Sending... / Thinking even though the prompt never reaches the model provider.

Verification

  • pnpm --filter pilotdeck-ui build
  • Manually reproduced the local chat flow after isolating HMR from /ws.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant