# Getting an error using zoomSdk package in npm

**URL:** <https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974>\
**Category:** Zoom Apps\
**Created:** [July 11, 2022, 4:26am UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974 "2022-07-11T04:26:09Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![srekhi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/srekhi/32/36393_2.png) [@srekhi](https://devforum.zoom.us/u/srekhi)\
**Post date:** [July 11, 2022, 4:26am UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/1 "2022-07-11T04:26:09Z")

</div>

I installed the Zoom SDK via npm via:  
`npm install @zoom/appssdk --save`

This resulted in the following package installed, as reflected in package.json:  
`"@zoom/appssdk": "^0.16.1",`

I then import the zoom sdk into my code using the following:  
`import zoomSdk from '@zoom/appssdk'`

I then call config:

```auto
zoomSdk.config({
    popoutSize: {
        width: 600,
        height: 500
    },
    capabilities: [
        'openUrl',
        'getRunningContext',
        'getMeetingContext',
        'getMeetingUUID',
        'getUserContext',
        'getMeetingParticipants',
        'onSendAppInvitation'
    ]
})

```

But when I load my app, I get the following warnings and errors:

```auto
Method __esModule is not available in this version of Zoom Apps SDK and might not work correctly. Please, update your version of Zoom Apps SDK (app.bundle.js, line 78450)
Method default is not available in this version of Zoom Apps SDK and might not work correctly. Please, update your version of Zoom Apps SDK
TypeError: undefined is not a function (near '..._appssdk2.default.config...')"

```

Any ideas why this isn’t working?

I’m using Zoom Client Version: 5.11.1 (8356).

---

<div class="post-metadata">

**Author:** ![leon.cheng](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/leon.cheng/32/36069_2.png) [@leon.cheng](https://devforum.zoom.us/u/leon.cheng)\
**Post date:** [July 11, 2022, 2:57pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/2 "2022-07-11T14:57:17Z")

</div>

This might be related to an issue we are investigating internally (there may be a bug in our CJS default export).

Can I ask, what context are you using the `import` statement in? Backend or frontend? What framework are you using?

---

<div class="post-metadata">

**Author:** ![srekhi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/srekhi/32/36393_2.png) [@srekhi](https://devforum.zoom.us/u/srekhi)\
**Post date:** [July 11, 2022, 3:12pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/3 "2022-07-11T15:12:34Z")

</div>

I’m using this in our app frontend. Using the following frameworks:

```auto
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^5.0.6",
"webpack": "^1.13.3",
"babel-core": "^6.18.2",

```

---

<div class="post-metadata">

**Author:** ![leon.cheng](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/leon.cheng/32/36069_2.png) [@leon.cheng](https://devforum.zoom.us/u/leon.cheng)\
**Post date:** [July 11, 2022, 7:52pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/4 "2022-07-11T19:52:46Z")

</div>

Hmm okay. It is not obvious to me what might be causing it to error out on the frontend with those dependencies. If it is related to the CJS bug, then we plan to fix that sometime in the next couple of patch releases.

---

<div class="post-metadata">

**Author:** ![lukas1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lukas1/32/40732_2.png) [@lukas1](https://devforum.zoom.us/u/lukas1)\
**Post date:** [August 23, 2022, 12:04pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/5 "2022-08-23T12:04:06Z")

</div>

Has this been fixed? I’m getting a similar warning:

> ```
> console.warn
> Method __esModule is not available in this version of Zoom Apps SDK and might not work correctly. Please, update your version of Zoom Apps SDK
> 
> ```

Everytime I `import zoomSdk from "@zoom/appssdk";` when in jest tests, I am transpiling ts to js with ts-jest.

@zoom1234/appsdk version is 0.16.3.

---

<div class="post-metadata">

**Author:** ![JonStewart](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonstewart/32/36192_2.png) [@JonStewart](https://devforum.zoom.us/u/JonStewart)\
**Post date:** [August 24, 2022, 12:45am UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/6 "2022-08-24T00:45:40Z")

</div>

Sorry about this. We’re hoping to release a fix in September. For now, common js modules are not supported/ only ES6.

The work around for the moment is to use the CDN version of the Zoom Apps SDK, which is here:  
[https://appssdk.zoom.us/sdk.js](https://appssdk.zoom.us/sdk.js)

This will add the zoomSdk as a global variable to the window. You can use a script tag (make sure it’s ahead of any JS app bundles you need), or some folks just copy and paste and ship this inline with their html

---

<div class="post-metadata">

**Author:** ![lukas1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lukas1/32/40732_2.png) [@lukas1](https://devforum.zoom.us/u/lukas1)\
**Post date:** [August 24, 2022, 7:18am UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/7 "2022-08-24T07:18:33Z")

</div>

OK, Thanks, will be looking forward to the bug fix.

I do not want to add it using a script tag because - that way i am not getting the benefits of typescript when developing/running tsc. Also, we generate a index.html file in the build step, so adding the script tag there is more complicated than adding a dependency into our package.json

---

<div class="post-metadata">

**Author:** ![JonStewart](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonstewart/32/36192_2.png) [@JonStewart](https://devforum.zoom.us/u/JonStewart)\
**Post date:** [August 24, 2022, 6:27pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/8 "2022-08-24T18:27:15Z")

</div>

Apologies for the inconvenience!

Just in case this helps at all:

1. There _is_ a typescript definitions file in the npm package you’ve downloaded; you _might_ try copying that into your own project, & thereby take advantage of tsc. I haven’t tried this! Just a thought.
2. Does your build script offer a template?

---

<div class="post-metadata">

**Author:** ![RostislavR](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rostislavr/32/39790_2.png) [@RostislavR](https://devforum.zoom.us/u/RostislavR)\
**Post date:** [August 31, 2022, 10:26pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/9 "2022-08-31T22:26:00Z")

</div>

I was not able to get the

```auto
Method __esModule is not available in this version of Zoom Apps SDK...

```

message to disappear but I did remove the

```auto
Method default is not available in this version of Zoom Apps SDK and might not work correctly

```

by doing

```auto
import * as zoomSdk from '@zoom/appssdk

```

at least now I can run my tests without that message popping up all over the place.

But the flipside is that my code doesn’t compile properly with esbuild anymore. 🙂

zoomSdk compiles as `Void 0`

---

<div class="post-metadata">

**Author:** ![noelle.szombathy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/noelle.szombathy/32/32782_2.png) [@noelle.szombathy](https://devforum.zoom.us/u/noelle.szombathy)\
**Post date:** [October 3, 2022, 9:51pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/10 "2022-10-03T21:51:31Z")

</div>

@JonStewart is there a fix for this?

UPDATE:  
For those using vite / vitest, what worked for me was updating the vitest config to inline the package like so:

```auto
deps: {
  inline: ["@zoom/appssdk"],
},

```

---

<div class="post-metadata">

**Author:** ![ash.provost](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ash.provost/32/36610_2.png) [@ash.provost](https://devforum.zoom.us/u/ash.provost)\
**Post date:** [October 27, 2022, 11:03pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/11 "2022-10-27T23:03:03Z")

</div>

@srekhi @lukas1 @RostislavR

Are you all running typescript projects? How are you importing the sdk? What compiler / bundler are you using in your projects?

---

<div class="post-metadata">

**Author:** ![lukas1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lukas1/32/40732_2.png) [@lukas1](https://devforum.zoom.us/u/lukas1)\
**Post date:** [October 28, 2022, 7:23am UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/12 "2022-10-28T07:23:47Z")

</div>

yes @ash.provost , we’re running typescript. It is happening only while running jest tests, we use `babel-preset-react-app` to transpile code from TS to JS while running those. I import it like this:

```auto
import zoomSdk, {
  ConfigResponse,
  GetMeetingUUIDResponse,
  OnAuthorizedEvent,
} from "@zoom/appssdk";

```

The warning itself with some more information:

```auto
    console.warn
      Method __esModule is not available in this version of Zoom Apps SDK and might not work correctly. Please, update your version of Zoom Apps SDK

    > 1 | import zoomSdk, {
        | ^
      2 | ConfigResponse,
      3 | GetMeetingUUIDResponse,
      4 | OnAuthorizedEvent,

      at Object.get (../node_modules/@zoom/appssdk/dist/sdk.module.js:116:25)
      at _interopRequireDefault (../node_modules/@babel/runtime/helpers/interopRequireDefault.js:2:21)
      at Object.<anonymous> (src/zoomSdk/index.ts:1:1)

```

---

<div class="post-metadata">

**Author:** ![ash.provost](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ash.provost/32/36610_2.png) [@ash.provost](https://devforum.zoom.us/u/ash.provost)\
**Post date:** [November 1, 2022, 7:35pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/13 "2022-11-01T19:35:50Z")

</div>

We will be releasing a bugfix for this soon.

---

<div class="post-metadata">

**Author:** ![RostislavR](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rostislavr/32/39790_2.png) [@RostislavR](https://devforum.zoom.us/u/RostislavR)\
**Post date:** [November 8, 2022, 7:09pm UTC](https://devforum.zoom.us/t/getting-an-error-using-zoomsdk-package-in-npm/71974/14 "2022-11-08T19:09:57Z")

</div>

Not running a typescript project. sdk is installed via npm.
