# SendBirdCall Typescript Init Error

**URL:** <https://community.sendbird.com/t/sendbirdcall-typescript-init-error/601>\
**Category:** JavaScript\
**Tags:** sendbird-call, javascript\
**Created:** [July 9, 2020, 6:00am UTC](https://community.sendbird.com/t/sendbirdcall-typescript-init-error/601 "2020-07-09T06:00:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajasimonureed](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@rajasimonureed](https://community.sendbird.com/u/rajasimonureed)\
**Post date:** [July 9, 2020, 6:00am UTC](https://community.sendbird.com/t/sendbirdcall-typescript-init-error/601/1 "2020-07-09T06:00:48Z")

</div>

I’ve tried integrating SendBirdCall with my Angular application. I’m importing SendBirdCall as mentioned in github readme page. Like this.

import SendBirdCall as “sendbird-calls”;

but that gives me no module named `SendBirdCall` and then I tried with below.

import \* as SendBirdCall as “sendbird-calls”; and that leads to below error.

```auto
ERROR in node_modules/sendbird-calls/SendBirdCall.min.d.ts(29,44): error TS2304: Cannot find name 'int'.

```

Can you help me import SendBirdCall properly.

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [July 9, 2020, 2:38pm UTC](https://community.sendbird.com/t/sendbirdcall-typescript-init-error/601/2 "2020-07-09T14:38:11Z")

</div>

I too ran into a similar issue when attempting to utilize the `sendbird-calls` module with Typescript:

```auto
import SendBirdCall from 'sendbird-calls';

SendBirdCall.init();

```

and I was returned with

```auto
index.ts:1:8 - error TS1192: Module '"/Users/tylerhammer/Documents/Development/test/node_modules/sendbird-calls/SendBirdCall.min"' has no default export.

1 import SendBirdCall from 'sendbird-calls';

```

I also tried to compile this down with Babel and ES6, but I get a different error:

```auto
ReferenceError: self is not defined
    at /Users/tylerhammer/Documents/Development/test/node_modules/sendbird-calls/SendBirdCall.min.js:6:37339
    at /Users/tylerhammer/Documents/Development/test/node_modules/sendbird-calls/SendBirdCall.min.js:6:84
    at Object.<anonymous> (/Users/tylerhammer/Documents/Development/test/node_modules/sendbird-calls/SendBirdCall.min.js:6:165)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/tylerhammer/Documents/Development/test/lib/index.js:3:45)

```

This may require a support ticket. Unfortunately I can’t look through the .min file.

---

<div class="post-metadata">

**Author:** ![Cobb\_Jung](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/cobb_jung/32/350_2.png) [@Cobb\_Jung](https://community.sendbird.com/u/Cobb_Jung)\
**Post date:** [July 10, 2020, 12:55am UTC](https://community.sendbird.com/t/sendbirdcall-typescript-init-error/601/3 "2020-07-10T00:55:24Z")

</div>

Hi rajasminonured and Tyler I’m Cobb from Sendbird. Thanks for your report!

The reported error is a known issue, and our declaration file type error causes it. We’ve already made a patch for it and preparing for release.

We’ll keep you updated when it’s release.

Thanks for your patience.

---

<div class="post-metadata">

**Author:** ![Cobb\_Jung](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/cobb_jung/32/350_2.png) [@Cobb\_Jung](https://community.sendbird.com/u/Cobb_Jung)\
**Post date:** [July 10, 2020, 8:10am UTC](https://community.sendbird.com/t/sendbirdcall-typescript-init-error/601/4 "2020-07-10T08:10:46Z")

</div>

Hi Tyler, the above answer was for rajasmiounureed’s report, and the answer for your report is below.

As our JS SDK is intended to be used in browser environment, you cannot import it in nodejs environment.

Please refer to whatwg-fetch for more information.

Thanks

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [July 10, 2020, 10:10pm UTC](https://community.sendbird.com/t/sendbirdcall-typescript-init-error/601/5 "2020-07-10T22:10:46Z")

</div>

Thank makes total sense. I’ve used Node for so long and have only recently started playing with Frontend. Its tripped me up a couple of times. Appreciate the clarification.

---

<div class="post-metadata">

**Author:** ![Junyoung\_Lim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/junyoung_lim/32/353_2.png) [@Junyoung\_Lim](https://community.sendbird.com/u/Junyoung_Lim)\
**Post date:** [July 14, 2020, 11:23am UTC](https://community.sendbird.com/t/sendbirdcall-typescript-init-error/601/6 "2020-07-14T11:23:47Z")

</div>

@rajasimonureed @Tyler

Hello. I’m Junyoung from SendBird. Thanks for your precious report.

- If you are using TypeScript, you have to set [‘–esModuleInterop’ setting to true for ‘default import’](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop). README and documentation will be updated soon to prevent confusion.
- There was a typo in the declaration file, which throw an error in TypeScript compilation. It is fixed in the latest release.
- Importing `sendbird-calls` in Node environment threw an error. For the convenience of development, it is fixed in the latest release. **Of course, the `sendbird-calls` is still supposed to be run on the browser**.

Latest release is [here](https://github.com/sendbird/sendbird-calls-javascript/releases/tag/1.1.4). Thank you.
