Uncaught TypeError: io is not a function
See original GitHub issueI am using Laravel echo like so in my bootstrap.js
import Echo from 'laravel-echo';
window.Echo = new Echo({
broadcaster: 'socket.io',
host: 'http://localhost:3000',
});
I am using Laravel’s inbuilt webpack to transpile my JS. And I am getting this on my console:
app.js:6604 Uncaught TypeError: io is not a function
at SocketIoConnector.connect (app.js:6604)
at SocketIoConnector.Connector (app.js:6172)
at new SocketIoConnector (app.js:6594)
at new Echo (app.js:6691)
at Object../resources/assets/js/bootstrap.js (app.js:66564)
at __webpack_require__ (app.js:679)
at fn (app.js:89)
at Object../resources/assets/js/app.js (app.js:66448)
at __webpack_require__ (app.js:679)
at fn (app.js:89)
I can’t find in the documentation on how can I import io into Echo. Any ideas?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
TypeError: io is not a function · Issue #1287 - GitHub
You want to: report a bug request a feature Current behaviour socket.io does not work, throws obtuse error message when trying to implement....
Read more >TypeError: io.connect is not a function - Stack Overflow
I am having a problem when i am trying to connect to the socket server. I get an error saying TypeError: io. connect...
Read more >Migrating from 2.x to 3.0 - Socket.IO
A v3 client is still not be able to connect to a v2 server though. ... TypeError: stream_1.pipeline is not a function at...
Read more >Error node js socket io socket io js not found - Edureka
Getting the error: /socket.io/socket.io.js 404 (Not Found) Uncaught ReferenceError: io is not defined. My code is:
Read more >i got this error TypeError require listen is not a function - Reddit
i got this error TypeError require listen is not a function ... var io = require('socket.io').listen(server); io.on('connection',(socket)=>{
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(Just so the question is explicitly answered…)
io
must be a function:or you must provide a
client
:@AndrewMast cool, thanks for the code snippet 😃