use Standalone Client Tips: Error: ws does not work in the browser. Browser clients must use the native WebSocket object #1062

error is global is not define
may edit vite.config.js
export default defineConfig({ ..., define: { global: "globalThis", }, });
and then add Buffer in main.ts
import { Buffer } from "buffer"; window.Buffer = Buffer;

 

posted @ 2022-10-09 15:38  小不点灬  阅读(1064)  评论(0编辑  收藏  举报