0

I struggle to find the lines of errornous code in Internet Explorer 11 as the Console is pointing to the wrong resource (pointing to HTML instead of JS code). How could I possibly find out where the actual problem can be found?

Console errors

(SCRIPT1003 is "Expected ''" and SCRIPT1028 would be "Expected identifier, string or number")

enter image description here

Lines of code the error refers to

Line 4 and 5:

Line 4 and 5

Line 12:

report-template line 12

2
  • I think the issue is not related to the meta tag, perhaps you used incorrect literal syntax to declare an object literal, try to check your javascript code, ensure you use the proper literal syntax. Besides, can you post the Enough code (or create a codepen sample ) to reproduce the problem as in Minimal, Complete, and Verifiable example?
    – Zhi Lv
    Commented May 25, 2020 at 11:52
  • @ZhiLv-MSFT thanks for your comment. Yes, I checked that I did not use any short-hand syntax for function declarations. I would also create a MRE but as mentioned the Console does not point to any code that may contain the issue. The entire application has roughly 30 different <script> tags so I can't post this in a fiddle or pen.
    – SaschaM78
    Commented May 25, 2020 at 12:03

1 Answer 1

0

Leaving this answer to my own question so others might also stumble over it with the same problem.

In case any script file is loaded asynchronously after the initial page has been loaded, the file name reported in the Console will point to the file that performed the loading of the resource. In my case I used JQuery's $.getScript() method to handle the task:

  translationInitHandler.initialise(function() {
    store.commit('setTranslation', window.defaultTranslationHandler.getCatalogueTranslations());
    $.getScript('../src/app/report-template/warning.app.js');
    $.getScript('../src/app/report-template/list.app.js');
    $.getScript('../src/app/report-template/authorize.app.js');
    $.getScript('../src/app/report-template/edit-configure.app.js?3');
  }, false);

Funny thing is that the mentioned line and column refer to the right position in the loaded script. In my case I had (in IE11's view) an invalid property in a Vue application that had been included:

window.createApp = new Vue({
  el: '#create-view',
  store, // triggers IE error
  data: {
    ...
  },
  ...
});

Not the answer you're looking for? Browse other questions tagged or ask your own question.