elementorModules is not defined
-
I added the following code to
functions.phpto defer all JavaScript except for/wp-content/plugins/elementor/assets/js/frontend.min.js, and it worked fine.if (!(is_admin() )) {
function my_defer_js( $tag, $handle, $src ) {
if ( FALSE === str_contains( $src, '.js' ) ) return $tag;
if ( str_contains( $src, 'js/frontend.min.js' ) ) return $tag;
$tag = '<script src="' . esc_url( $src ) . '" defer charset="UTF-8" id="' . esc_attr( $handle ) . '-js"></script>';
return $tag;
}
add_filter( 'script_loader_tag', 'my_defer_js', 10, 3 );
}However, after updating Elementor to 4.3.0 or later, the following error started appearing in the console:
frontend.min.js?ver=4.3.4:1 Uncaught ReferenceError: elementorModules is not defined
at frontend.min.js?ver=4.3.4:1:20490
at frontend.min.js?ver=4.3.4:1:151
at frontend.min.js?ver=4.3.4:1:21651
at frontend.min.js?ver=4.3.4:1:151
at frontend.min.js?ver=4.3.4:1:55071
at frontend.min.js?ver=4.3.4:1:151
at frontend.min.js?ver=4.3.4:1:60015
at frontend.min.js?ver=4.3.4:1:60019This revealed the following issues:
elementor-background-slideshowandelementor-widget-image-carouseldo not work- The
e-n-tab-titletabs do not switch - When attempting to open the Elementor editor, the message “The preview could not be loaded” appears and the editor cannot be opened.
Investigation revealed that the following two additional files must be excluded to prevent them from being deferred:
/wp-includes/js/jquery/jquery.min.js/wp-content/plugins/elementor/assets/js/frontend-modules.min.js
Dependencies may have changed in Elementor version 4.3.0 and later.
For your reference.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.