ngx-socket-io icon indicating copy to clipboard operation
ngx-socket-io copied to clipboard

Using EIO3 with Angular 14.0.1

Open gustavohleal opened this issue 3 years ago • 2 comments

Hello!

For the first time I'm making an application that need to use Socket.io. I started the app with Angular 14.0.1 and after coding some other features I now need to add a socket conexion with the server. The only problem is that the server is using Socket.io 2.3 with EIO3 and the version of ngx-socket-io that uses Socket.io v2 is not compatible with Angular 14. Or there is some way to solve it? Didn't tried to install it with --force yet.

Does anyone have some tips on how to make it work?

gustavohleal avatar Aug 08 '22 12:08 gustavohleal

Got the same issue. @gustavohleal did you find a solution?

etavenerInmarsat avatar Feb 20 '23 14:02 etavenerInmarsat

Got the same issue. @gustavohleal did you find a solution?

Hi. Yes, i finded. I had to install the socket.io-client package in version 2.5.0 then declare a module and the io variable in the file typings.d.ts like this:

declare var io:any;
declare module 'socket.io-client';

Then imported as import * as io from 'socket.io-client'; in the component that i used. The rest is done as the socket.io documentation explains.

gustavohleal avatar Feb 20 '23 23:02 gustavohleal