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: 
In angular 10 works fine:

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

```

This is the official documentation
<https://socket.io/docs/v3/client-api/index.html>
changing import statement to

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

```

works fine for `"socket.io-client": "^4.3.2"` and above

while starting connection, use this statement:

```
    this.socket = io(< server url >, {query: { <your data object> });

```

in previous version, query key used to accept string and objects, now it shows type error for string