I'm building a phaser game with a webpack template and I'm running it in a node server at 8080, and this client side is listening the socket.io server running at 3000.
The game and server are running fine, listening and connecting.
The problem came when I've decided to add a socket.io chat at the index.html.
I don't know exactly what the webpack adds behind template index.html, but if I put the basic chat script at index.html which is basically empty, since its just a webpack template.
Webpack should already take care of adding socke.io.js at the template but i can't get io to work on the script side so as followed in the tutorial I've added this src"="/socket.io..." line
<script src="/socket.io/socket.io.js"></script>
<script>
const socket = io('http://localhost:3000');
...
</script>
the console claims GET http://localhost:8080/socket.io/socket.io.js net::ERR_ABORTED 404 (Not Found) and Uncaught ReferenceError: io is not defined.
the client module game is working with import io from 'socket.io-client';
How can I import io inside html? Is that what I'm missing?