Closed
Description
Describe the bug
The same code with webpack works. But Vite.js + Vue 3 is not. There is even no requests. Probably it's not problem of socket.io-client package but something wrong with socket.io-client.
To Reproduce
Socket.IO server version: 4.2.0
Server
import { Server } from "socket.io";
const io = new Server(3000, {});
io.on("connection", (socket) => {
console.log(`connect ${socket.id}`);
socket.on("disconnect", () => {
console.log(`disconnect ${socket.id}`);
});
});
Socket.IO client version: 4.2.0
Client
import { io } from "socket.io-client";
const socket = io("ws://localhost:3000/", {});
socket.on("connect", () => {
console.log(`connect ${socket.id}`);
});
socket.on("disconnect", () => {
console.log("disconnect");
});
Expected behavior
Expected to see console.log messages on server and client. But it's not working at all.
Platform:
- OS: [e.g. Windows 10]