I’m trying to integrate Zoom Meeting Web SDK with Client view with Vitejs(+ react) https://vitejs.dev/. When using any function related with ZoomMtg like ZoomMtg.preLoadWasm(); I get a blank page with a javascript error:
"zoomus-websdk.umd.min.js:2 Uncaught TypeError: _.debounce is not a
function".
Thank you for posting in the Developer Forum. The behavior you are seeing is likely due to the react version you are using. You use React 18, so this may be the root cause of the behavior you are seeing as we package build with React 16. Please do try to downgrade your react version to 16. Also, to resolve the _.debounce error, can you use the script below to introduce lodash and you will also need to add css scripts here
zoomus-websdk.umd.min.js:2 Uncaught TypeError: c2 is not a function
at dt (zoomus-websdk.umd.min.js:2:3638431)
at 48575 (zoomus-websdk.umd.min.js:2:2831595)
at webpack_require (zoomus-websdk.umd.min.js:2:6924410)
at 63301 (zoomus-websdk.umd.min.js:2:2059217)
at webpack_require (zoomus-websdk.umd.min.js:2:6924410)
at 89381 (zoomus-websdk.umd.min.js:2:2064660)
at webpack_require (zoomus-websdk.umd.min.js:2:6924410)
at 20623 (zoomus-websdk.umd.min.js:2:2924528)
at webpack_require (zoomus-websdk.umd.min.js:2:6924410)
at 65007 (zoomus-websdk.umd.min.js:2:2931873)
Thanks for your contributions, @idoia! Can you share if you are still facing problems getting the SDK working with Vite? If so, are you able to share a repo so I can test it on my end?
You may also be interested in referencing our React Meeting SDK sample app implementation.
Also, I noticed you are calling ZoomMtg.preLoadWasm() inside of useEffect, can you try calling ZoomMtg.preLoadWasm() and ZoomMtg.prepareJssdk() functions. in the first couple of lines :
Hi @donte.zoom, thanks for answering. I’ve followed your advices but I’m still facing problems. I don’t have the javascript problems (_.debounce, c2 is not a function ), but I get a black screen all the time because of the #zmmtg-root element. I guess there is something that is not loading correctly. I have a repo and some screenshots or a video showing the error but I can’t share it with the post (Sorry, you can’t embed media items in a post.):
github repo: https://github.com/IdoiaRojo/video-call-error
@donte.zoom, you are completely right, I had forgotten that I had already added the class, so thanks for that; the problem is when I exit the zoom view from the “join meeting” view (using back button on the browser for example), if I try to catch the onpopstate event to hide the zmmtg-root element, it stays with the red dot in the browser tab, and if I try to use the ZoomMtg.leaveMeeting function I get an error saying errorMessage: "Please join meeting first!", is there any way to do it correctly without having to reload the page? Thanks!!
Great question! When you say red dot in the browser tab, are you referring to dot the displays when recording? If so, Chrome displays a blinking red dot in the page’s tab as long as the site is recording. To confirm, can you please provide me with a screenshot so we can help in a better way?
To that end, I’d recommend checking to see if there is a way to programmatically stop the browser recording or remove the permission to allow recording before hiding the zmmtg-root element.
Aside from showing/hiding of the zmmtg-root element as recommended above, this is contingent on the user experience you are looking to accomplish and your implementation approach.
Please provide more context on the user experience you are looking to create by using the back button. It will also be helpful to understand what alternatives have you considered to produce the same result as well.