• Resolved Ryan

    (@digitallion)


    Hey,

    In IE11 there is an error in the JS console when autoptimize JS is running:

    SCRIPT1003: Expected ‘:’ autoptimize_b3146ecf2b3188d6ffb4c2a689c5ddde.js (99,757)

    It works fine and there is no error in the console when using MS Edge or other browsers. What is causing this and how can we fix it? Is something about the Autoptimize plugin not compatible with Internet Explorer?

    Ryan

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Ryan

    (@digitallion)

    This is what I see on line 99 when I click that error in the console FYI:

    var product_id=$(‘#tm-extra-product-options’).attr(“data-product-id”);label_array.push(“Total Items”);label_array.push(“Options amount”);label_array.push(“Total amount”);var options_info={data_array:data_array,label_array:label_array,name_array:name_array,product_id:product_id,options_amount:options_amount,total_amount:total_amount,data_array1:data_array1,name_array1:name_array1};var options_encode=JSON.stringify(options_info);var options_var_value=var_value;var options_var_value1=type_value;var fees=sum;var base_url=window.location.href;var url=base_url.substring(0,base_url.indexOf(“product”));var request_url=url+”wp-content/plugins/woocommerce-product-designer/public/js/extra_options.php”;$.ajax({url:request_url,type:”POST”,data:{options_encode,options_var_value,options_var_value1,ordernotes,jobname,fees},success:function(result){},error:function(exception){}});});});

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Can you go to that same page in IE11 with ?ao_noptimize=1 added to the URL and check the console for JS errors once more Ryan?

    Thread Starter Ryan

    (@digitallion)

    When I do that, the error is still there, but the page loads completely. When I don’t have that in the URL, the essential portion of the page doesn’t load. Maybe it has nothing to do with that IE11 error?

    Thread Starter Ryan

    (@digitallion)

    Another difference I see is that when I add that variable to the URL, I see this in the console:
    JQMIGRATE: Migrate is installed, version 1.4.1
    When that variable is not in the URL, that message is missing from the console. Could Autoptimize be blocking JQMigrate, causing the issue?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, we’re getting there 🙂 with that string in the URL, which JS-file is the reported in?

    Thread Starter Ryan

    (@digitallion)

    The JS error about expecting a semi-colon? That is in wpd.js. However, the page works fine with that string in the URL even with the error still showing in the console.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, can you now add wpd.js to the comma separated JS optimization exclusion list and re-try without that ?ao_noptimize string?

    Thread Starter Ryan

    (@digitallion)

    That did it! Thanks! So, I guess that JS error was preventing the rest of the combined JS file from running, which caused the issue?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    So, I guess that JS error was preventing the rest of the combined JS file from running, which caused the issue?

    that is exactly what happens, yes; browsers stop executing a JS-file when encountering an error. that way the error in wpd.js was “poisoning” the autoptimized file and excluding it indeed prevents that from happening.

    Thread Starter Ryan

    (@digitallion)

    Understood. Thank you again for your help! I’ll see if I can make that file backwards compatible to IE11 so that I can include it in autoptimize again. Thank you for an amazing plugin!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    You’re welcome Ryan, feel free to leave a raving review here! 😉

    Thread Starter Ryan

    (@digitallion)

    Will do!

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Autoptimize error in IE11’ is closed to new replies.