最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Internet Explorer Developer Tools does not show source code using RequireJS - Stack Overflow

matteradmin10PV0评论

I am attempting to debug a page issue where IE 9 will work the first time on my requirejs/backbone application, but will fail on the page reload. However, when I attempt to debug this problem using the f12 IE developer tools, I cannot navigate to the source to set a breakpoint because IE does not load any of the files that RequireJS includes. How can I get around this issue to fix my IE headache??

I am attempting to debug a page issue where IE 9 will work the first time on my requirejs/backbone application, but will fail on the page reload. However, when I attempt to debug this problem using the f12 IE developer tools, I cannot navigate to the source to set a breakpoint because IE does not load any of the files that RequireJS includes. How can I get around this issue to fix my IE headache??

Share Improve this question asked Feb 21, 2013 at 17:45 Matt BroekhuisMatt Broekhuis 2,0753 gold badges29 silver badges35 bronze badges 2
  • 2 Does clicking the refresh icon in the HTML tab make a difference? – epascarello Commented Feb 21, 2013 at 17:47
  • It does refresh all the script tags that requirejs has written to the dom in the HTML view. However, the script tab does not reflect these new scripts (can't see them) – Matt Broekhuis Commented Feb 22, 2013 at 16:36
Add a ment  | 

3 Answers 3

Reset to default 4

I guess I am late for the party but hope my answer helps you and others as well. The file that you want to debug or the line in the file, simply add this --> debugger; before that line.

So, when require.js loads your script and encounter that string i.e. debugger; exists it will automatically be stopped at that line.

You can generate a single js File with require tools :

  • include requirejs in this single file (http://requirejs/docs/optimization.html#onejs)
  • set optimise to none (no source minified - http://requirejs/docs/optimization.html#shallow)

In your index.html link this file instead of require.js.

You can debug with IE.

I have the same problem from time to time. What sometimes helps: Close all the files in Debugger view, leave the DevTools open, press Play to allow page to continue and then make your action on the page or reload - if it halts on the debugger; again, all the files will be loaded. But still investigating ;)

Post a comment

comment list (0)

  1. No comments so far