Description
The application works fine on local host, however it crashes on production. It seems as if the zoom websdk is not being minified properly. A very similar issue is discussed in React 16 error on after build - #8 by vincent.engelmann1
On that post they give the solution of creating a config-overrides.js file to change the way it is minified by Uglyfy plugin.
However another user says that React may be using Terser plugin.
Is it official that only React 15 is supported by zoom-web-sdk? I am currently using React 17.0.1 and deploying on AWS Amplify Console.
I would like some guidance on how to proceed with this. I believe it is an important topic as many React developers might experience this.
Thanks!
Errors
zoomus-websdk.umd.min.js:2 Uncaught TypeError: Cannot read property āerrorā of undefined
at B (zoomus-websdk.umd.min.js:2)
at Object.generateSignature (zoomus-websdk.umd.min.js:2)
at Zoom.jsx:44
at Ns (react-dom.production.min.js:262)
at t.unstable_runWithPriority (scheduler.production.min.js:18)
at Wo (react-dom.production.min.js:122)
at Rs (react-dom.production.min.js:261)
at react-dom.production.min.js:261
at L (scheduler.production.min.js:16)
at MessagePort.w.port1.onmessage (scheduler.production.min.js:12)
react-dom.production.min.js:216 TypeError: Cannot read property āerrorā of undefined
at B (zoomus-websdk.umd.min.js:2)
at Object.generateSignature (zoomus-websdk.umd.min.js:2)
at Zoom.jsx:44
at Ns (react-dom.production.min.js:262)
at t.unstable_runWithPriority (scheduler.production.min.js:18)
at Wo (react-dom.production.min.js:122)
at Rs (react-dom.production.min.js:261)
at react-dom.production.min.js:261
at L (scheduler.production.min.js:16)
at MessagePort.w.port1.onmessage (scheduler.production.min.js:12)
Which version?
ā@zoomus/websdkā: ā^1.8.3ā
āreactā: ā^17.0.1ā,
To Reproduce(If applicable)
Steps to reproduce the behavior:
Create react app npx create-react-app zoom-app
Follow the instructions to create your zoom/websdk application
Make sure everything works fine on localhost
Deploy into production (IĀ“m using AWS Amplify)
Run the application
Device (please complete the following information):
Thank you for reaching out to Zoom Developer Support. Are you able to share a public Git repo where this issue can be reproduced? That will help us to troubleshoot the issue. I would also confirm that in production the requisite library files are being loaded in the same way they are when running the application locally.
The next problem that people will face is that their screen will be black because of #zmmtg-root element which needs to have a hide CSS style.
I believe that if you clarify those issues on the main docs people wouldnĀ“t have a hard time integrating zoom. Iāve seen most people struggling with these issues.
Please let us know what is the best practice to import the zoom web sdk, as currenlty the app crashes.
Thanks for your feedback regarding using the Web SDK in a React app.
Regarding the error you are experiencing, I would make sure that in your production environment on AWS that all the required Web SDK files are present and accessible.
Then when actually launching the meeting I keep getting the same known two errors:
*TypeError: Cannot read property āerrorā of undefined
I also tried changing the way the zoom web sdk gets minified using both UglifyJS and Terser with no success.
Importing through CDN :
The sdk seems to load successfully, however when trying to launch the meeting the same two known errors occur.
Note that in order to have access to ZoomMtg object I had to access it as window.ZoomMtg, otherwise React app wouldnĀ“t build.
Conclusion:
Both ways of importing the SDK bring the same errors.
It looks like for some reason the production build is not liking the minified version of zoomwebsdk, maybe loading another zoom web sdk version or a none minified one could make the trick, but anyway it is very strange.
Looking forward to debug this and get a working React sample app. Would be great if we can have another meeting early next week. Please let me know.
Appreciate you sharing an update and sorry to hear you are still having trouble. We will be building a Web SDK React sample app this week, and will share it with you.
Thank you for the feedback. @tommy has done a great job writing up the sample application and we are currently working to verify it follows best practices before making it public. Once we have it finished, weāll be sure to send it your way.
FYI finally I imported the zoom web sdk through CDN, probably the easiest way to do this atm. @tommy should soon publish a React sample app showing how to do this. Note that on the CDN I had to access the *ZoomMtg* object as follows:
BTW I cannot find how to modify the title of this thread or adding more labels to it it should include AWS Amplify keywords as it is actually an AWS Amplify issue, cheers!
Iām so glad to hear that you resolved your issues! I went ahead and updated the title so that it reflects the issue. If you encounter any further issues or questions, please donāt hesitate to reach out.