socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

App Crashed on iOS

Open gulsher7 opened this issue 2 years ago • 2 comments

Describe the bug My app is crashed when i initialise my socket on ios device.

To Reproduce

Please fill the following code example:

Socket.IO server version: 2.1.1

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: 2.1.1

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 should be working

Platform:

  • Device: [e.g. iphone 14 Pro]
  • OS: [e.g. ios 16.1.1]

gulsher7 avatar Mar 08 '23 18:03 gulsher7

Can you explain it a bit more and why are passing in an empty object to the constructors?

haneenmahd avatar Apr 30 '23 09:04 haneenmahd

@gulsher7 is there any logs in the console?

darrachequesne avatar Jun 20 '23 23:06 darrachequesne