Javascript IE11 对象中的错误不支持此操作和预期的标识符

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

我的网站在 IE11 中有 2 个错误。我的 select2 和 Google 地图无法正常工作。我查看了错误所在的代码,但没有发现任何异常。

错误是:

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
});

该网站基于 WordPress。 link 到网站 www.wp-suspenion.com

有什么建议、想法、解决方案吗?

谢谢

在您的 app.js 文件的第 26 行,您在 DealerInquiry 之后有一个逗号,这使您的代码在它之后期待另一个参数。这就是产生第一个错误的原因。

第二个错误可能是因为你传递给对象"App"的东西是不能通过new实例化的东西。如果您已经传递了一个对象的实例,则无需通过 new 创建它,如果它是一个函数,则可以直接使用 App(); 执行它;不使用新的。