ngx-socket-io
ngx-socket-io copied to clipboard
Using EIO3 with Angular 14.0.1
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?
Got the same issue. @gustavohleal did you find a solution?
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.