1

I am integrating zoom meeting into magento 2.3.

I have added following code in requirejs-config.js to import/include the 3rd party js files :

var config = {
map: {
    '*': {
        react: 'https://source.zoom.us/1.8.6/lib/vendor/react.min.js',
        reactDom: 'https://source.zoom.us/1.8.6/lib/vendor/react-dom.min.js',
        redux: 'https://source.zoom.us/1.8.6/lib/vendor/redux.min.js',
        reduxThunk: 'https://source.zoom.us/1.8.6/lib/vendor/redux-thunk.min.js',
        loadSh: 'https://source.zoom.us/1.8.6/lib/vendor/lodash.min.js',
        meeting: 'https://source.zoom.us/zoom-meeting-1.8.6.min.js'
    }
},
shim: {
    'react': {
        'deps': ["jquery"]
    },
    'reactDom': {
        'deps': ["react","jquery"]
    },
    'meeting': {
        'deps': ["react", "reactDom","redux","reduxThunk","loadSh","jquery"]
    }
},
deps :['domReady!']

};

But it gives me an error in browser console. Can anyone help me out from this error?

Uncaught ReferenceError: React is not defined
    at Object.<anonymous> (zoom-meeting-1.8.6.min.js:2)

1 Answer 1

0

I managed to get it to work, but it's quite a clunky method. It boils down to Zoom relying on global declarations of everything, and requirejs like to scope the scripts to the module. Forget about using shims with this.

define(["dataservice", "text!./zoom-tool.html", "react", "reactDom", "redux", "reduxThunk", "lodash", "cryptojs"], 
    function (dataservice, htmlString, react, reactdom, redux, reduxthunk) {
    
    window.React = react;
    window.ReactDOM = reactdom;
    window.Redux = redux;
    window.ReduxThunk = reduxthunk;
    require(['zoom']);

...    do zoom things here...
1
  • Hi, I had solved the issue by removing default magento js & css via xml. There was some js conflict with zoom library & mage/requirejs/mixins.js Commented Sep 3, 2021 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.