Support » Plugin: GDPR Cookie Compliance (CCPA ready) » moove_frontend_gdpr_scripts is not defined

  • Resolved gicoprasico

    (@gicoprasico)


    Hi.

    It seems that with latest update you brake a hook to: moove_frontend_gdpr_scripts.

    As we update your plugin we got the following error:

    main.js:formatted:1760 Uncaught ReferenceError: moove_frontend_gdpr_scripts is not defined
    at HTMLDocument.loadEvents (main.js:formatted:1760)
    at i (jquery.js:formatted:1332)
    at Object.fireWith [as resolveWith] (jquery.js:formatted:1386)
    at Function.ready (jquery.js:formatted:1480)
    at HTMLDocument.J (jquery.js:formatted:1492)

    the error line:

    loadEvents: function() {
    var t = !1;
    void 0 !== moove_frontend_gdpr_scripts.geo_location && “true” === moove_frontend_gdpr_scripts.geo_location ? jQuery.post(moove_frontend_gdpr_scripts.ajaxurl, {
    action: “moove_gdpr_localize_scripts”
    },

    Regards Igor

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @gicoprasico,

    Thanks, for using our plugins.

    It seems you’re using a caching plugin (Autoptimize, WP-rocket, etc) where the inline scripts are combined. Please ensure the “moove_frontend_gdpr_scripts” is excluded from this rule otherwise our plugin can’t check the dependencies and load the scripts properly.
    Related topic: https://support.mooveagency.com/topic/moove_frontend_gdpr_scripts-is-not-defined/

    Hope this helps

    Hi, I have this same problem.
    I use WP-rocket.
    I have excluded the main.js.

    But I have an error in the console that says:
    main.js Uncaught ReferenceError: moove_frontend_gdpr_scripts is not defined

    I’ve followed the steps in this tutorial and can’t get it to work. I have also read the attached link.

    I use this on my platform and I think that is the problem. (Rel link here: https://wordpress.org/support/topic/add-preload-to-litty-css-to-improve-performance/)
    add_action (‘gdpr_enqueue_lity_nojs’, ‘__return_false’);
    add_action (‘gdpr_cc_prevent_ajax_script_inject’, ‘__return_true’)

    Can you help me?

    Hi,

    I had the same ‘moove_frontend_gdpr_scripts is not defined’ error and found this page. I was using WP Rocket so removed the main.js script from caching but didn’t work. Even deactivating WP Rocket completely.

    I managed to find the issue : it was related to the enqueue of jquery in my template. I had to change it and wasn’t using the proper way to do so. So for the GDPR plugin on line 501 of the class-moove-gdpr-actions.php file the code
    wp_enqueue_script( 'moove_gdpr_frontend', plugins_url( basename( dirname( __FILE__ ) ) ) . '/dist/scripts/main.js', array( 'jquery' ), MOOVE_GDPR_VERSION, true ); couldn’t call the jquery file properly.

    I changed it to wp_enqueue_script( 'moove_gdpr_frontend', plugins_url( basename( dirname( __FILE__ ) ) ) . '/dist/scripts/main.js', array(), MOOVE_GDPR_VERSION, true ); and now everything works fine. I know it’s not the right way but it may help people to find the issue !

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @ptitsuisse,

    Thanks for your comments.

    The fix will be included in our next version (will be released early next week).

    Hope this helps.

    Plugin Author Moove Agency

    (@mooveagency)

    Hello,

    This has been fixed in our latest version. Please update the plugin and add this hook to your functions.php

    add_filter('gdpr_main_script_depends_on', 'gdpr_main_script_depends_on');
    function gdpr_main_script_depends_on( $deps ) {
      return array();
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.