Support

Account

Home Forums Bug Reports Intermittent Javascript Error prevents page from rendering Reply To: Intermittent Javascript Error prevents page from rendering

  • @robgordon

    The issue had come and gone, but has resurfaced again with the latest version of ACF Pro (6.3.8) so I was just revisiting today.

    It appears that they have wrapped the localization script for a value (isLicenseActive) that is used by addProLocations in an if (is_admin()) script. (acf-pro.php line 127) So it is not available on the front end causing that js error.

    Adding the following to your js enqueue function seems to solve the problem. I am also going to open a bug on the issue.

    $to_localize = array(
    					'isLicenseActive'  => acf_pro_is_license_active(),
    					'isLicenseExpired' => acf_pro_is_license_expired(),
    				);
    
    				acf_localize_data( $to_localize );