# Unable to init meeting

**URL:** <https://devforum.zoom.us/t/unable-to-init-meeting/8133>\
**Category:** Web\
**Created:** [February 19, 2020, 3:12pm UTC](https://devforum.zoom.us/t/unable-to-init-meeting/8133 "2020-02-19T15:12:26Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![saurabh](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/saurabh/32/1925_2.png) [@saurabh](https://devforum.zoom.us/u/saurabh)\
**Post date:** [April 9, 2020, 10:42am UTC](https://devforum.zoom.us/t/unable-to-init-meeting/8133/22 "2020-04-09T10:42:43Z")

</div>

> [@tommy](#):
>
> Sample App

Is there any better way to fix this?

Thanks

---

<div class="post-metadata">

**Author:** ![michael\_p.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_p.zoom/32/18105_2.png) [@michael\_p.zoom](https://devforum.zoom.us/u/michael_p.zoom)\
**Post date:** [April 10, 2020, 6:58am UTC](https://devforum.zoom.us/t/unable-to-init-meeting/8133/23 "2020-04-10T06:58:55Z")

</div>

Hi @saurabh,

We are working to fix this bug but right now the workaround would be to use the setTimeout method.

Thanks

---

<div class="post-metadata">

**Author:** ![vk-jangid](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vk-jangid/32/20761_2.png) [@vk-jangid](https://devforum.zoom.us/u/vk-jangid)\
**Post date:** [December 29, 2020, 10:55pm UTC](https://devforum.zoom.us/t/unable-to-init-meeting/8133/24 "2020-12-29T22:55:51Z")

</div>

I am facing an issue where when I use useEffect to join the meeting then, I am getting an error which i am consoling it in the terminal from the response coming in success attribute of init and join methods and the error is - “{method: “init”, status: false, errorCode: 3008, errorMessage: “Please init meeting first!”, result: null}”. This is coming in the success method of join method.  
But the ZoomMtg.init function response is - “{method: “init”, status: true, errorCode: 0, errorMessage: null, result: null}”.  
This error is not coming when I am not using useEffect to call the function.

```
const Meeting = (props) => {
    const getMeetingConfig = () => ({
        meetingNumber: parseInt(props.params.mn),
        apiKey: API_KEY,
        apiSecret: API_SECRET,
        role: 1,
        userName: 'Vk',
        passWord: props.params.pass,
        leaveUrl: '/zoom-poc',
        userEmail: ''
    })

    const createSignature = () => {    
        const meetingConfig = getMeetingConfig();
        ZoomMtg.generateSignature({
            meetingNumber: meetingConfig.meetingNumber,
            apiKey: meetingConfig.apiKey,
            apiSecret: meetingConfig.apiSecret,
            role: meetingConfig.role,
            success: (res) => {
                beginJoin(res.result)
            },
        });
    }

    const beginJoin = (signature) => {
        const meetingConfig = getMeetingConfig();

        ZoomMtg.init({
            leaveUrl: meetingConfig.leaveUrl,
            isSupportAV: true,
            success: (success) => {
                console.log(success)
                ZoomMtg.join({
                    meetingNumber: meetingConfig.meetingNumber,
                    userName: meetingConfig.userName,
                    signature,
                    apiKey: meetingConfig.apiKey,
                    userEmail: meetingConfig.userEmail,
                    passWord: meetingConfig.passWord,
                    success: (res) => {
                        console.log("join meeting success");
                    },
                    error: (res) => {
                        console.log(res);
                    },
                });
            },
            error: (res) => {
                console.log(res);
            },
        });
    }, 2000)
    };

    useEffect(() => {
        ZoomMtg.setZoomJSLib('https://source.zoom.us/1.8.5/lib', '/av');
        ZoomMtg.preLoadWasm();
        ZoomMtg.prepareJssdk();
        createSignature()
    }, [])

    return (
        <div id='zmmtg-root' />
    )
}

export default Meeting;
```

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [December 30, 2020, 6:09pm UTC](https://devforum.zoom.us/t/unable-to-init-meeting/8133/25 "2020-12-30T18:09:47Z")

</div>

Hey @vk-jangid,

Thank you for reaching out to the Zoom Developer Forum. Please try moving the following lines to the top of the file so that we can ensure they are always set before any other code runs and the scope they reside in is available for all functions on the page.

```auto
        ZoomMtg.setZoomJSLib('https://source.zoom.us/1.8.5/lib', '/av');
        ZoomMtg.preLoadWasm();
        ZoomMtg.prepareJssdk();

```

If you’re looking for more detail on how this can be configured, please see our [Sample Web App](https://github.com/zoom/sample-app-web/blob/1a18ccebab315e6dc5e42a06d91f915cb41203d3/Local/js/index.js#L10-L11).

I hope that helps! Let me know if you have any questions.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![vk-jangid](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vk-jangid/32/20761_2.png) [@vk-jangid](https://devforum.zoom.us/u/vk-jangid)\
**Post date:** [December 30, 2020, 7:06pm UTC](https://devforum.zoom.us/t/unable-to-init-meeting/8133/26 "2020-12-30T19:06:11Z")

</div>

I am using the CDN way of implementing the zoom SDK, so I already tried what you are suggesting, but It throws an error saying that ZoomMtg is not defined.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [December 30, 2020, 8:17pm UTC](https://devforum.zoom.us/t/unable-to-init-meeting/8133/27 "2020-12-30T20:17:21Z")

</div>

Hey @vk-jangid,

Are you using a framework (Angular.js, Vue.js, React, etc.) when you’re getting this error? On that same note, are you using a JS bundler such as Webpack? If you’re able to provide a public git repo of the code that exhibits this issue, I’ll be sure to troubleshoot it more in-depth on my end.

Thanks,  
Max

[Previous page](https://devforum.zoom.us/t/unable-to-init-meeting/8133.md?page=1)
