Closed KKMrTan closed 2 years ago
直接报错:TypeError: io is not a function
/ 代码 / const io = require('./utils/weapp.socket.io.js') App({ onLaunch() { this.initSocket() }, initSocket() { const socket = io('ws://127.0.0.1:3000/voval', { transports: ['websocket'] }) } })
路径是没错的
到你Official Framework这里复制的weapp.socket.io.js可以了,自己下载打包的报错
直接报错:TypeError: io is not a function
/ 代码 / const io = require('./utils/weapp.socket.io.js') App({ onLaunch() { this.initSocket() }, initSocket() { const socket = io('ws://127.0.0.1:3000/voval', { transports: ['websocket'] }) } })