Home > other >  How to debug MDN Web Docs examples?
How to debug MDN Web Docs examples?

Time:01-23

Suppose I have enter image description here

But can I trace/debug it with breakpoints with looking how it goes?

Where is the source code of this example located in developer tools in Chrome or FireFox? And/or how to unminify it?

enter image description here

CodePudding user response:

Where it's located: probably in a dynamic module, possibly using eval or new Function, generated immediately before its run so you won't find it before that.

Instead, you can add a debugger statement where you want a breakpoint, or just at the first line so it breaks into the right source module immediately and you can set other breakpoints in the debugger as needed.

Then open your devtools and run. Wait for it to break at the debugger statement and do your debugging.

  •  Tags:  
  • Related