Bug with custom Elementor widget using latest Elementor
-
Hi,
I’m developing a custom widget for Elementor and ran into some issues after updating to the latest version 3.24 +
In the console, there are these 2 errors (showing up on the front-end of the site ) :
#1)
Uncaught TypeError: Cannot read properties of undefined (reading 'handlers')
at 820 (frontend.min.js?ver=3.24.2:2:4477)
at __webpack_require__ (webpack-pro.runtime.min.js?ver=3.24.2:2:150)
at 4906 (frontend.min.js?ver=3.24.2:2:4134)
at __webpack_require__ (webpack-pro.runtime.min.js?ver=3.24.2:2:150)
at 3000 (frontend.min.js?ver=3.24.2:2:139)
at __webpack_require__ (webpack-pro.runtime.min.js?ver=3.24.2:2:150)
at frontend.min.js?ver=3.24.2:2:24995
at webpackJsonpCallback (webpack-pro.runtime.min.js?ver=3.24.2:2:5854)
at frontend.min.js?ver=3.24.2:2:69
elementor-pro/assets/js/frontend.min.js?ver=3.24.2screenshot: https://snipboard.io/4bGuN6.jpg
#2)
Uncaught TypeError: Cannot read properties of undefined (reading 'tools')
at Frontend.initOnReadyComponents (frontend.min.js?ver=3.24.3:2:7393)
at Frontend.init (frontend.min.js?ver=3.24.3:2:9297)
at HTMLDocument.<anonymous> (frontend.min.js?ver=3.24.3:2:9523)
at e (jquery.min.js?ver=3.7.1:2:27028)
at t (jquery.min.js?ver=3.7.1:2:27330)
wp-includes/js/jquery/jquery.min.js?ver=3.7.1screenshot: https://snipboard.io/HhRKVP.jpg
I have created a custom elementor widget with Javascript by following these tutorials:
https://developers.elementor.com/add-javascript-to-elementor-widgets/
https://developers.elementor.com/building-a-simple-custom-widget-with-javascript/The problem occurs when registering a script with the ‘elementor-frontend’ dependency.
My code:
wp_register_script( 'custom-slider-swiper-js', plugin_dir_url(dirname( FILE )).'assets/main-slider/public/js/script.js', ['elementor-frontend' ], '1.0.0', true );
When I removed the ‘elementor-frontend’ dependency, those 2 errors doesn’t show up.
Also the errors occurs only when I am logged in (when previewing the front-end of the site).
When I am logged out, the error doesn’t show up on the front-end.To avoid these issues/errors I had to roll back to version 3.23.3 for both Elementor + Elementor Pro. Those errors doesn’t show up on version 3.23.3 (and down).
Can the ‘elementor-frontend’ dependency issue be fixed on the latest version of Elementor?
Thanks!
- You must be logged in to reply to this topic.