weapp-socketio / weapp.socket.io

A WebSocket client for building WeChat Mini Program implement by socket.io
http://weappsocket.matong.io
MIT License
682 stars 172 forks source link

TypeError: io is not a function #86

Closed KKMrTan closed 2 years ago

KKMrTan commented 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'] }) } })

KKMrTan commented 2 years ago

路径是没错的

KKMrTan commented 2 years ago

到你Official Framework这里复制的weapp.socket.io.js可以了,自己下载打包的报错