However, once deployed to a server this can have unintended side effects. The easier solution is to change it from a. This unfortunately is a project wide setting as far as I can tell, and I rather like the ability to debug. First, we can disable source map generation. There are two immediate solutions to this problem. Basically when run, Webstorm was appending a source map to the bottom of our js file, rendering into invalid JSON and causing the parser to puke. As you can see, sometimes this is not ideal however.
#Phpstorm debug javascript code
See, Webstorm has the ability to generate something called a SourceMap, which helps the debugger translate your running code to the code you created, especially useful if you, like me, are working in a JavaScript generating language like TypeScript. I really need to write a debugging tutorial….Ĭopy the value and paste it into your editor of choice. Again, if you don’t know what this is, drop everything and go learn. Now we are going to use a feature called “Evaluate Expression”. That said, let’s take a look at the whole thing. So… to the debugger! Let’s see what the value of responseText is:īy hovering over it, everything looks fine, seems to match the file we are expecting: You will literally become a better programmer overnight. If you don’t know about breakpoints and debugging, drop everything and learn. As you can see on line 11960 I’ve set a breakpoint to pause execution before our exception, let’s see if that gives us any insight. As we can tell from the above code, the callback executed all nice and dandy.
Basically it’s a XML response function handler. Ok, that’s some pretty straight forward code.
Just click the link “three.js:11960” and it will automatically download that script file and go to that position. This is one of those things that makes WebStorm so freaking cool. Well, other than the fact we know we have a / where we shouldn’t, we also have the line of code that is going all explodey. Well we wouldn’t make the big bucks if this was easy now would we? Well, first obvious thing is to look for an offending / in this code. load ( "dice.jsm", function (geometry ,materials )