Search code examples
javascriptinternet-explorer-11jquery-select2

Javascript Errors in IE11 Object doesn't support this action & Expected identifier


I have a website that has 2 errors in IE11. My select2 and Google Maps are not working correctly. I looked at the code where the errors are but did not find anything unusual.

The errors are:

SCRIPT1010: Expected identifier
app.js (27,2)

SCRIPT445: Object doesn't support this action
main.js (37,5)

app.js:

define([
    'jquery',
    'owl',
    'select2',
    'scrollto',
    'header',
    'productfinderform',
    'productdetail',
    'procomponents',
    'authorizedcenters',
    'compinquiryform',
    'imageslidermodule',
    'dealerinquiry',
], function(
    $,
    Owl,
    Select2,
    ScrollTo,
    Header,
    ProductFinderForm,
    ProductDetail,
    ProComponents,
    AuthorizedCenters,
    ComponentsInquiryForm,
    ImageSliderModule,
    DealerInquiry,
    ){                           <-- this is line 27

main.js:

require([ 'app'], function(App) {
    'use strict';
    var app = new App();           <-- this is line 37
});

the website is based on WordPress. link to the website www.wp-suspenion.com

Any suggestion, idea, solution?

Thanks


Solution

  • On your app.js file, at line 26, you have a comma after DealerInquiry which is making your code to expect another param after it. This is what is producing the first error.

    The second error is probably caused because what you are passing into the object "App" is something that cannot be instantiated through new. If you are passing already an instance of an object you don't need to create it through new, and if it's a function you can execute it directly with App(); without using new.