skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. 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".

    jQuery(function($) {
    
    /* Rest of code in file goes here
    
    });
    
    Login or Signup to reply.
  3. If you are getting the element from a jquery function, you need to extract the raw DOM element first

    var e = $("#item1");
    var d = e[0];
    d.dispatchEvent(new Event('change',{ 'bubbles': true }));
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search