# Black screen when joining meeting with Meeting SDK and NextJS

**URL:** <https://devforum.zoom.us/t/black-screen-when-joining-meeting-with-meeting-sdk-and-nextjs/98393>\
**Category:** Web\
**Created:** [November 15, 2023, 1:42am UTC](https://devforum.zoom.us/t/black-screen-when-joining-meeting-with-meeting-sdk-and-nextjs/98393 "2023-11-15T01:42:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![goldcare](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@goldcare](https://devforum.zoom.us/u/goldcare)\
**Post date:** [November 15, 2023, 1:42am UTC](https://devforum.zoom.us/t/black-screen-when-joining-meeting-with-meeting-sdk-and-nextjs/98393/1 "2023-11-15T01:42:27Z")

</div>

**Description**  
I am trying to implement the Zoom Meeting SDK on my Next JS app. Everything works fine until I join the room. It is working until the waiting room. But when the host lets me in, he sees me in the meeting but I got a black screen and errors on console.

**Browser Console Error**

> instrument.js:122 ReferenceError: React is not defined  
> at Z (zoomus-websdk.umd.min.js:2:1710663)  
> at zoomus-websdk.umd.min.js:2:1653009  
> at l9 (react-dom.production.min.js:153:144)  
> at c (react-dom.production.min.js:261:494)  
> at aj (react-dom.production.min.js:246:259)  
> at react-dom.production.min.js:246:191  
> at aI (react-dom.production.min.js:246:191)  
> at react-dom.production.min.js:123:110  
> at t.unstable\_runWithPriority (scheduler.production.min.js:19:460)  
> at lt (react-dom.production.min.js:122:318)  
> at ll (react-dom.production.min.js:123:61)  
> at lr (react-dom.production.min.js:122:496)  
> at aF (react-dom.production.min.js:240:55)  
> at Object.notify (zoomus-websdk.umd.min.js:2:6674270)  
> at Object.notifyNestedSubs (zoomus-websdk.umd.min.js:2:6674681)  
> at s (zoomus-websdk.umd.min.js:2:6674081)  
> at g (redux.js:296:1)  
> at index.js:20:1  
> at dispatch (redux.js:691:1)  
> at Module.eX (zoomus-websdk.umd.min.js:2:1146600)  
> at zoomus-websdk.umd.min.js:2:1205990  
> at index.js:16:1  
> at eK (zoomus-websdk.umd.min.js:2:4019154)  
> at Object.handleOnMessage (zoomus-websdk.umd.min.js:2:4020307)  
> at a..a..onmessage (zoomus-websdk.umd.min.js:2:4021060)

> Uncaught ReferenceError: React is not defined  
> at Z (zoomus-websdk.umd.min.js:2:1710663)  
> at zoomus-websdk.umd.min.js:2:1653009  
> at l9 (react-dom.production.min.js:153:144)  
> at c (react-dom.production.min.js:261:494)  
> at aj (react-dom.production.min.js:246:259)  
> at react-dom.production.min.js:246:191  
> at aI (react-dom.production.min.js:246:191)  
> at react-dom.production.min.js:123:110  
> at t.unstable\_runWithPriority (scheduler.production.min.js:19:460)  
> at lt (react-dom.production.min.js:122:318)  
> at ll (react-dom.production.min.js:123:61)  
> at lr (react-dom.production.min.js:122:496)  
> at aF (react-dom.production.min.js:240:55)  
> at Object.notify (zoomus-websdk.umd.min.js:2:6674270)  
> at Object.notifyNestedSubs (zoomus-websdk.umd.min.js:2:6674681)  
> at s (zoomus-websdk.umd.min.js:2:6674081)  
> at g (redux.js:296:1)  
> at index.js:20:1  
> at dispatch (redux.js:691:1)  
> at Module.eX (zoomus-websdk.umd.min.js:2:1146600)  
> at zoomus-websdk.umd.min.js:2:1205990  
> at index.js:16:1  
> at eK (zoomus-websdk.umd.min.js:2:4019154)  
> at Object.handleOnMessage (zoomus-websdk.umd.min.js:2:4020307)  
> at a..a..onmessage (zoomus-websdk.umd.min.js:2:4021060)

> zoomus-websdk.umd.min.js:2 Uncaught TypeError: b.AK.connectSocket is not a function  
> at e$ (zoomus-websdk.umd.min.js:2:1148875)  
> at zoomus-websdk.umd.min.js:2:1192692  
> at index.js:16:1  
> at eK (zoomus-websdk.umd.min.js:2:4019154)  
> at Object.handleOnMessage (zoomus-websdk.umd.min.js:2:4020307)  
> at a..a..onmessage (zoomus-websdk.umd.min.js:2:4021060)

**Which Web Meeting SDK version?**  
2.18.0

**Meeting SDK Code Snippets**  
My Zoom component

```auto
/* eslint-disable consistent-return */
import { Box } from '@chakra-ui/react';
import React, {
  useCallback,
  useContext,
  useEffect,
} from 'react';

import { useRouter } from 'next/router';

import { ZoomMtg } from '@zoomus/websdk';
import axios from 'axios';
import { MeContext } from 'modules/_shared/contexts/MeContext';

ZoomMtg.setZoomJSLib('https://source.zoom.us/2.18.0/lib', '/av');

ZoomMtg.preLoadWasm();
ZoomMtg.prepareWebSDK();
// loads language files, also passes any error messages to the ui
ZoomMtg.i18n.load('en-US');
ZoomMtg.i18n.reload('en-US');

const MeetingPage: React.FC = function () {
  const router = useRouter();
  const {
    id,
  } = router.query;

  const { me } = useContext(MeContext);

  const startZoomClient = useCallback(async (): Promise<void> => {
    const { data: { signature } } = await axios.post('/api/zoom', { role: 0, meetingNumber: id });

    ZoomMtg.init({
      leaveUrl: '/patient',
      success: (success: any) => {
        ZoomMtg.join({
          sdkKey: process.env.ZOOM_MEETING_SDK_KEY_OR_CLIENT_ID,
          signature,
          meetingNumber: id as string,
          userName: me?.name || 'Patient',
          success: (s: any) => {
            console.log(s);
          },
          error: (error: any) => {
            console.log(error);
          },
        });
      },
      error: (error: any) => {
        console.log(error);
      },
    });
  }, [id, me?.name]);

  useEffect(() => {
    startZoomClient();
  }, []);

  return (
    <Box />
  );
};

export default MeetingPage;

```

And my route page

```auto
/* eslint-disable consistent-return */
import React from 'react';

import dynamic from 'next/dynamic';

const Zoom = dynamic(() => import('./components/Zoom'), {
  ssr: false,
});

const MeetingPage: React.FC = function () {
  return (
    <Zoom />
  );
};

export default MeetingPage;

```

**Device (please complete the following information):**

- Device: Macbook Air M1
- OS: [e.g. macOS 13]
- Browser: Chrome
- Browser Version 119.0.6045.123 (Official Build) (arm64)

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [November 16, 2023, 3:31am UTC](https://devforum.zoom.us/t/black-screen-when-joining-meeting-with-meeting-sdk-and-nextjs/98393/2 "2023-11-16T03:31:23Z")

</div>

@goldcare

Are you using Client view or component view?

If you are using client view, you will need to use react 16.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/b/6b65549898bac481d82553580ca667afcc88fa92.png)

> **[Meeting SDK - web - client view - Import](https://developers.zoom.us/docs/meeting-sdk/web/client-view/import/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![goldcare](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@goldcare](https://devforum.zoom.us/u/goldcare)\
**Post date:** [November 21, 2023, 9:35pm UTC](https://devforum.zoom.us/t/black-screen-when-joining-meeting-with-meeting-sdk-and-nextjs/98393/3 "2023-11-21T21:35:19Z")

</div>

I need to use the client view.

I saw this requirement of react 16 and then I gave up to implement it inside my app and tried to use the react sample app cause my project requires react 18.

So I cloned the sample from github and changed the react version of it to 16 ( because it’s react 18.2 in the github project): [GitHub - zoom/meetingsdk-react-sample: Use the Zoom Meeting SDK in React](https://github.com/zoom/meetingsdk-react-sample)

So when I tried to run it I had the same error. React is not defined and a bunch of other errors.

What am I missing? I just cloned the sample app, tried to run (without success), changed the react version in the package json to 16.14 and tried again. Same errors on both attempts.

```auto
ERROR
[object Object]
    at handleError (http://localhost:3001/static/js/bundle.js:330939:58)
    at http://localhost:3001/static/js/bundle.js:330962:7
ERROR
React is not defined
ReferenceError: React is not defined
    at B (http://localhost:3001/static/js/bundle.js:70480:28)
    at http://localhost:3001/static/js/bundle.js:67575:65
    at renderWithHooks (http://localhost:3001/static/js/bundle.js:315718:22)
    at mountIndeterminateComponent (http://localhost:3001/static/js/bundle.js:318048:17)
    at beginWork (http://localhost:3001/static/js/bundle.js:318985:20)
    at HTMLUnknownElement.callCallback (http://localhost:3001/static/js/bundle.js:303015:18)
    at Object.invokeGuardedCallbackDev (http://localhost:3001/static/js/bundle.js:303059:20)
    at invokeGuardedCallback (http://localhost:3001/static/js/bundle.js:303107:35)
    at beginWork$1 (http://localhost:3001/static/js/bundle.js:322888:11)
    at performUnitOfWork (http://localhost:3001/static/js/bundle.js:322009:16)
ERROR
React is not defined
ReferenceError: React is not defined
    at B (http://localhost:3001/static/js/bundle.js:70480:28)
    at http://localhost:3001/static/js/bundle.js:67575:65
    at renderWithHooks (http://localhost:3001/static/js/bundle.js:315718:22)
    at mountIndeterminateComponent (http://localhost:3001/static/js/bundle.js:318048:17)
    at beginWork (http://localhost:3001/static/js/bundle.js:318985:20)
    at HTMLUnknownElement.callCallback (http://localhost:3001/static/js/bundle.js:303015:18)
    at Object.invokeGuardedCallbackDev (http://localhost:3001/static/js/bundle.js:303059:20)
    at invokeGuardedCallback (http://localhost:3001/static/js/bundle.js:303107:35)
    at beginWork$1 (http://localhost:3001/static/js/bundle.js:322888:11)
    at performUnitOfWork (http://localhost:3001/static/js/bundle.js:322009:16)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)
ERROR
m.AK.connectSocket is not a function
TypeError: m.AK.connectSocket is not a function
    at tn (http://localhost:3001/static/js/bundle.js:43449:157)
    at rn (http://localhost:3001/static/js/bundle.js:46177:69)
    at http://localhost:3001/static/js/bundle.js:46871:26
    at http://localhost:3001/static/js/bundle.js:327601:18
    at Yt (http://localhost:3001/static/js/bundle.js:183143:69)
    at Object.handleOnMessage (http://localhost:3001/static/js/bundle.js:183177:26)
    at i.<computed>.i.<computed>.onmessage (http://localhost:3001/static/js/bundle.js:183212:26)

```

Here’s my package json:

```auto
{
  "name": "meetingsdk-sample-react",
  "version": "2.18.0",
  "author": "Zoom Video Communications, Inc.",
  "contributors": [
    {
      "name": "Tommy Gaessler"
    }
  ],
  "homepage": "",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^6.1.4",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "^14.5.1",
    "@zoomus/websdk": "^2.18.0",
    "react": "16.14.0",
    "react-dev-utils": "^12.0.1",
    "react-dom": "16.14.0",
    "react-scripts": "^5.0.1",
    "web-vitals": "^3.5.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![goldcare](https://avatars.discourse-cdn.com/v4/letter/g/47e85d/32.png) [@goldcare](https://devforum.zoom.us/u/goldcare)\
**Post date:** [November 22, 2023, 2:27am UTC](https://devforum.zoom.us/t/black-screen-when-joining-meeting-with-meeting-sdk-and-nextjs/98393/4 "2023-11-22T02:27:09Z")

</div>

I got it working. The issue is with the latest SDK version. I downgraded to 2.17.0 and everything worked fine.

---

<div class="post-metadata">

**Author:** ![palejovr](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/palejovr/32/54323_2.png) [@palejovr](https://devforum.zoom.us/u/palejovr)\
**Post date:** [November 28, 2023, 9:52pm UTC](https://devforum.zoom.us/t/black-screen-when-joining-meeting-with-meeting-sdk-and-nextjs/98393/5 "2023-11-28T21:52:25Z")

</div>

I have the same problem but this solution does not work for me

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [November 29, 2023, 2:39am UTC](https://devforum.zoom.us/t/black-screen-when-joining-meeting-with-meeting-sdk-and-nextjs/98393/6 "2023-11-29T02:39:39Z")

</div>

Closed on November 29, 2023, 2:39am UTC


