score:0

you need to configure cors even on localhost in case the web application and your server are not served from the same port

revised socket.io initialization would be

const io = socketio(server, {
    cors: {
        origin: "http://localhost:3000",
        methods: ["get", "post"] // add the methods you want to allow
    }
});

Related Query

More Query from same tag