0

I'm trying to debug an issue that occur not on the first time, but on the second time I enter a page with Microsoft Edge.

This problem does not occur if I've got Developer Tools up; which makes it kind of tricky. I can't do anything with the page.

To complicate further I'm trying to debug an issue that occur on a page that integrate our solutions.

I know that console.log doesn't exist until you open Developer Tools, but I see nothing in the console. Are there other Developer Tools traps?

thoredge
  • 12,237
  • 1
  • 40
  • 55
  • maybe you could alert() some info, instead of console.log it, to avoid needed the dev tools to be opened? – MKougiouris Jun 26 '20 at 09:44
  • 1
    *"I know that console.log doesn't exist until you open Developer Tools, but I see nothing in the console."* That isn't true of Edge, and wasn't true in at least the last couple of releases of IE. `console.log` always exists, and if you log something, then later open the devtools, the messages will be in the console. (Of course, the downside is...you have to open devtools eventually in order to see them.) – T.J. Crowder Jun 26 '20 at 09:45
  • Don't know why this quantum observer effect occurs in your code, you can always try to `alert` or `document.write` information to the screen. – Hao Wu Jun 26 '20 at 09:47
  • Please check [this thread](https://stackoverflow.com/questions/7742781/why-does-javascript-only-work-after-opening-developer-tools-in-ie-once), perhaps you might have some debugging code in your javascript, try to remove them. If you want to debug without Developer tools, you could try to use the [Visual studio debugger](https://learn.microsoft.com/en-us/visualstudio/debugger/debugger-feature-tour?view=vs-2019) or [Visual Studio Code debugger](https://code.visualstudio.com/docs/editor/debugging). – Zhi Lv Jun 26 '20 at 11:13

1 Answers1

0

I doubt there's a single "right" answer here which might mean the question is off-topic for SO. I'll mark this answer CW; perhaps we can all add our suggestions here.

I know that console.log doesn't exist until you open Developer Tools, but I see nothing in the console.

That isn't true of Edge (or Chrome or Firefox), and wasn't true in at least the last couple of releases of IE. console.log always exists, and if you log something, then later open the dev tools, the previously-logged messages will be in the console. Of course, you can't see them until you open devtools. :-)

Some other things to try:

  • Perhaps the issue isn't hidden if devtools is open undocked? (Or if you normally use it undocked, try opening it undocked.)
  • Open a separate window and write to it via your own function.
  • Write messages via ajax to a server, observe them there.
T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875