Question: I am calling IO of socket.io-client in my angular project like below:

```
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/internal/Observable';
import * as io from 'socket.io-client';
@Injectable({
  providedIn: 'root'
})
export class SocketclientService {
  socket:any;
  url:any="ws://localhost:8080"
  constructor() {
    this.socket = io(this.url);
   }

   listen(eventname:any,data:any){
     return new Observable((subscriber)=>{
       this.socket.on(eventname,(data:any)=>{
         subscriber.next(data);
       })
     })
   }
   emit(eventname:string,data:any){
     this.socket.emit(eventname,data);
   } 
}

```

But I am always getting an error like:

```
 Error: src/app/services/socketclient.service.ts:11:19 - error TS2349: This expression is not callable.
      Type 'typeof import("C:/somepathtoproject/node_modules/socket.io-client/build/index")' has no call signatures.

    11     this.socket = io(this.url);
                         ~~

```

I am not getting it why this is showing, even I have installed @types/socket.io-client

Answer: 
I found a workaround for this, I explored the socket.io-client modules a bit and under 'index.d.ts' I found this line:

```
export { lookup as io, Socket, SocketOptions };

```

So I tried importing like this:

```
import {io} from 'socket.io-client/build/index';

```

then to use it:

```
this.socket=io(url);

```

it worked for me.
even I am also facing the same issues from last 2 days, Here is how I tackled this issue:

-> import \* as io from 'socket.io-client'; //gives error in newer version, not sure why.

so use-> import {io} from 'socket.io-client'; //it will not throw any error

1)Firstly the error is because of newer version of socket.io-client(i,e version>3.0- which got released few days back). So try using the most stable.(I used 2.3.0 both in client & in server side)
2)Make sure that the socket version which you are using in client side matches with the socket version used in server.