Socket instance is not returning connected: true on "connection" and having a type error when it's called outside of provider #4921
-
I'm using it through provider and I observe strange behaviour with it when I'm using it with Next.js 14.0.1 with TypeScript. Even it does not fire connected event on "connection" with; it does return and work with other methods followed like; The obvious thing i realized is the first logged event is There's also another problem with my implementation. In socket provider, it's ok without any problem to make a call with; but when i share socket instance through provider and make the exact same call, I got the error; Any idea or insights would be appreciated. PS: Currently socket context's type is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! "connection" is on the server side, it's "connect" on the client side: socket.on("connect", () => console.log("socket connected; ", socket)); |
Beta Was this translation helpful? Give feedback.
Hi! "connection" is on the server side, it's "connect" on the client side: