Getting an error using zoomSdk package in npm

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:

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:

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).

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?

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

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

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.

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.

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

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

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

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?

I was not able to get the

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

message to disappear but I did remove the

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

by doing

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. :slight_smile:

zoomSdk compiles as Void 0

@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:

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

@srekhi @lukas1 @RostislavR

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

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:

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

The warning itself with some more information:

    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)

We will be releasing a bugfix for this soon.

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