• Resolved Julia Reichbaum

    (@bigmattres)


    Hi!

    I’m developing a custom widget for Elementor and ran into this bug – on normal clean themes (TwentyTwenty One, etc.) the ElementorModules object has a frontend object, but on block themes (TwentyTwent Two, Three) it disappears, which causes an error and my widget script does not work.

    The error is Cannot read properties of undefined (reading ‘tools’) in the frontent.min.js file in the line StretchElement: elementorModules.frontend.tools.StretchElement.
    If I delete this line directly in this file, everything works fine.

    Please help me, how can I get around this?

    https://ibb.co/pJ3TV4s

Viewing 2 replies - 1 through 2 (of 2 total)
  • israelaz

    (@israelaz)

    Hi

    Can you please send me a link to your site?

    Thread Starter Julia Reichbaum

    (@bigmattres)

    Hey!

    Here is the previous version of the plugin with TwentyTwenty Three theme – https://gtb.bda.dev/calorie-calculator-elementor/.

    The problem occurs when registering a script with the ‘elementor-frontend’ dependency:
    wp_register_script( ‘wpcc-elementor-class-script’, WPCC_PLUGIN_URL . ‘/public/js/wp-calorie-calculator-public.js’, array( ‘elementor-frontend’ ), $version, true );

    In fact, I already solved this problem yesterday using the solution suggested recently here – https://github.com/elementor/elementor/issues/19709 – by connecting scripts not in function get_script_depends() as written in the documentation, but manually via add_action( ‘wp_enqueue_scripts’, array( $this, ‘manually_enqueue_scripts’ ), 9999 ).

    I described this problem back in Nov 22, but so far it still hasn’t been solved. However, I noticed that this problem is marked ‘evaluating’, so it’s probably already in the works.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Bug with custom Elementor widget and Block themes’ is closed to new replies.