0

I understand what this error mean, and why it happens. The question is how to find code, that causes the error.

  • Enabling dev tools (f12) adds console variable, and no error is shown
  • Javascript debugging is enabled in browser, but still IE doenst offer to debug the error. debugging enabled

Are there any ideas how to find a place where console is missing and used?

Sly
  • 15,046
  • 12
  • 60
  • 89

3 Answers3

1

Well, I would go the following way: - Save the entire webpage (including all scripts, styles and images) to the hard drive - search through the files for console.log

Dmitri Tsoy
  • 561
  • 6
  • 21
0

Another option is to create a dummy console object with stubbed functions.

Peter Tseng's answer on this question is quite good: 'console' is undefined error for Internet Explorer

Community
  • 1
  • 1
Jeremy J Starcher
  • 23,369
  • 6
  • 54
  • 74
0

Well console is not "missing", that is how that version of IE works.

To find where it is used:

  1. Open up the developer tools in IE.
  2. Click on the scripts tab.
  3. Use the search box.

Console Screenshot

Best practice is to not leave console lines in code. There are workarounds like checking if console is available before using it, but all that does is add overhead to your code.

epascarello
  • 204,599
  • 20
  • 195
  • 236