Ask coding questions

← Back to all posts
Socket.io.js not found
MaxwellGeringer (0)

I am trying to make a chat app with socket.io, but it isn't working. I believe that the problem is when I link to the socket.io.js file, it isn't found, and if I try to access that file in the web browser, it gives me a "Cannot GET /socket.io/socket.io.js". Is this a problem with replit, as in another repl I have, socket.io and that file works fine.

Answered by Coder100 (18146) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (18146)

it has to be http.listen

so socket.io can even make that path work.

// wrong
app.listen(300);
// right
http.listen(8080);
tussiez (1666)

Works for me, click the checkmark under @Coder100's comment to accept it as an answer :)