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>
Your import statement is incorrect, it should look like this

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

```

If you look into [type definition](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/socket.io-client/index.d.ts#L8) you can see that it is declared as

```
declare module 'socket.io-client' {
 export = io;
}

```

which according to [this](https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require) means that it

> 
> The export = syntax specifies a single object that is exported from the module
> 
> 
> 

which if I understand correctly is similar to [default export](https://www.typescriptlang.org/docs/handbook/modules.html#default-exports) that require above import syntax