Closed pexch closed 2 years ago
@flyingspoon You can try install socket.io-client
version 3.1.3 to fix this
I believe it was resolved by using a different version of this laravel-echo-module
, ended up coding my own version. But thanks for trying to help!
I have a similar error:
TypeError: io is not a function
connect echo.js:1190
Connector echo.js:951
_createSuperInternal echo.js:129
SocketIoConnector echo.js:1171
connect echo.js:1455
Echo echo.js:1429
NuxtJS 2
Babel 36
NuxtJS 3
js app.js:59
__webpack_require__ runtime.js:859
fn runtime.js:151
0 app.js:12263
__webpack_require__ runtime.js:859
checkDeferredModules runtime.js:46
webpackJsonpCallback runtime.js:33
<anonymous> app.js:1
client.js:102
_callee$ NuxtJS
Babel 8
NuxtJS 2
js app.js:59
__webpack_require__ runtime.js:859
fn runtime.js:151
0 app.js:12263
__webpack_require__ runtime.js:859
checkDeferredModules runtime.js:46
webpackJsonpCallback runtime.js:33
<anonyme> app.js:1
Looking at the top of the trace, the pertaining code block is
_createClass(SocketIoConnector, [{
key: "connect",
value: function connect() {
var _this2 = this;
var io = this.getSocketIO();
this.socket = io(this.options.host, this.options);
this.socket.on('reconnect', function () {
Object.values(_this2.channels).forEach(function (channel) {
channel.subscribe();
});
});
return this.socket;
}
/**
* Get socket.io module from global scope or options.
*/
},
With console.log(io)
, just after the line var io = this.getSocketIO();
returning:
Object { io: Getter, connect: Getter, default: Getter, Manager: Getter, Socket: Getter, protocol: Getter, … }
Any hint would be warmly welcome.
Already ran,
npm install --save-dev @nuxtjs/laravel-echo npm install socket.io-client