I am getting this error when trying to open Elementor with my custom theme meaning that Elementor page builder won’t open. Has anyone come across this before?
Uncaught TypeError: e.dispatchEvent is not a function
at Function.dispatch (frontend.min.js?ver=3.6.5:2:34013)
at Frontend.init (frontend.min.js?ver=3.6.5:2:8627)
at Editor.initFrontend (editor.min.js?ver=3.6.5:2:322468)
at Editor.onPreviewLoaded (editor.min.js?ver=3.6.5:2:335102)
at Editor.onPreviewLoaded (editor.min.js?ver=3.6.5:2:344642)
at HTMLIFrameElement.dispatch (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.3:2:43064)
at HTMLIFrameElement.v.handle (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.3:2:41048)
3
Answers
This is a jquery issue. I had the same error, it was because jquery was loaded twice, two versions. The one that was puzzling me was getting loaded by GTM, so I couldn’t find it in the code.
Michael is right I had the same issue. But the jQuery was hidden in a .js file within the theme.
So just double check jQuery isn’t being loaded twice within your themes .js files.
When I found the second copy and removed it, I was receiving an error regarding the "$ is not a function".
If you are getting the element from a jquery function, you need to extract the raw DOM element first