Window undefined with 1.8.5

Getting window is not defined error when trying to integrate web SDK
ReferenceError: window is not defined
at Object. (…/node_modules/@zoomus/websdk/dist/zoomus-websdk.umd.min.js:2:504)

Which version?

Additional context

      export const Zoom = () => {
      useEffect(() => {
    ZoomMtg.setZoomJSLib("", "/av");
      meetingNumber: zoomConfig.meetingNumber,
      apiKey: zoomConfig.apiKey,
      apiSecret: zoomConfig.apiSecret,

  role: zoomConfig.role,
  success: function (res) {
    setTimeout(() => {
      joinMeeting(res.result, zoomConfig);
    }, 1000);

    console.log("res", res);
  }, []);
  return <>Zoom will be here</>;

I added :

 <link type="text/css" rel="stylesheet"href=""/>

<link type="text/css" rel="stylesheet"href=""/>
<script src=""></script>    

still not working any ideas where is this coming from ?

Hey @Safwen,

Can you please provide steps to reproduce the issue? I am not seeing this issue when testing on my end.

If you are using React, you can see the Web SDK React Sample App here:


Hi @tommy

Thank you for reaching out I really appreciate the effort you’re putting here:
So basically it’s NextJS app and currently I got it to work by doing this:

inside the useEffect of the zoom component:

    useEffect(() => {
      import("@zoomus/websdk").then((module) => {
      const { ZoomMtg } = module;
      ZoomMtg.setZoomJSLib("", "/av");

Still wondering why a simple import had to be this way
it could be something with the SSR nature of Next but still it doesn’t make lot of sense to me

Also another question :
I notice when I navigate to another route without ( hitting the zoom meeting leave button ) when I click on my join button it throws an error : ’ you need to initiate a meeting ’ which the button does already but it seems it only works upon refreshing
So my question is do I need to clean the meeting manually when navigating to another route?

Hey @Safwen,

Happy to hear you got it sorted out! :slight_smile:

I am not too familiar with Next, so I don’t know the specifics of how imports work.

Hm, after leaving a meeting you should be able to join another one. Make sure the ZoomMtg.init function is being called again. :slight_smile:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.