ActiveState Powered by ActiveState

ActiveState Community


JavaScript Debugger

Posted by kai on 2007-04-04 02:16

I have just installed Komodo IDE 4.0 because I was very happy with Kommodo Edit AND desperately in need for a JavaScript debugger.

Unfortunately I cannot get it to work. I have already inactivated FireBugs and restartet FireFox after that, and I have also successfully "connected", but nothing happens at all.

ericp | Wed, 2007-04-04 09:44

Are you using the URI mapping preference to map files from the
web server space to the file system? This is usually how
Komodo handles breakpoints.

What happens if you add the statement

debugger;

to a JavaScript function that you know is being invoked?
This statement should always trigger a break event.

Does the "break at next statement" flag button work?

Finally, what kind of JavaScript are you running? While
we've successfully debugged bookmarklets as well as traditional
code, long eval strings can be hard to walk through.

virshu | Sat, 2007-05-26 22:26

I am trying to get JavaScript debugger working in 4.1, and also without success. I disabled FireBug; and (I hope) followed all the instructions. When I click "Connect to Komod Debugger" button in FireFox toolbar - the debugger gets engaged. That is, there is a message "Debugger is running...", and Debug->Listener Status shows a connection (and also increments the number of connections). However, I tried "Break on next Java Statement", and also tried putting debugger; statement in the code, and put breakpoints on the statements in the tutorial, but the breakpoint never kicks in, and the debugger never takes control.

Any other suggestions?

Thanks in advance. Debugger is listening on port 9000, and FWIW, PHP debugger works perfectly fine

Thanks in advance

Update: It seems to be working if I am running the web page from localhost. However, the tutorial instructs to show the page in the browser; which loads the file from the file system. In such case (from the file system) I can't make the debugger to work. With localhost and Mapped URI the debugger comes up. However, I can't make the code break at *my* breakpoints. But that's, of course, is another problem.

Additionally, javascript tutorial has some other "bugs".

  1. YUI files are in the wrong directories (different from the ones main files refers to)
  2. the text for buttons doesn't match the actual (for example, the help text refers to "Tools | Komodo JavaScript Debugger | Enable Debugging" - and the actual menu text says "Connect to Komodo Debugger"; same for the button)
  3. I can't make the debugger break at my breakpoints

So, while the debugger interface seems a little bit nicer than FireBug - it just doesn't seem to be worth the effort.

ericp | Mon, 2007-05-28 11:50

The debugger works better when the JavaScript files are served via an
http://localhost URL rather than a file:/// one, and with the correct
URI mapping in place.

Clear all the breakpoints on the JS files.

Add a temporary debugger statement to the file you want to break in.

When you're stopped, set other breakpoints in that file. The debugger
should now honor them, even on subsequent sessions after you remove
the debugger statement.

Eval'ed code is breakable, but is messier.

We'll have a look at the tutorial instructions.

SaltyFoam | Tue, 2007-12-18 00:44

I am running Windows XP, Firefox 2.0.0.11, Komodo 4.2.1

My file is located at D:\Web\AjaxForm.html and Firefox is loading the file via http://localhost/AjaxForm.html.

I setup a Mapped URI using the above two and it was accepted fine (saved to global preferences) but when I return to this dialog it leaves the URI field blank so I'm not sure if it is saving this information.

Komodo reports 1 current session and 1 current connection. Selecting "Connect to Komodo Debugger" in Firefox simply toggles the icon status from "Disconnected" to "Stopped". I can't get any other state. The Total Connections in Komod is sitting at 3 and doesn't move any more. I restarted Firefox and Komodo and tried again with same results.

Adding a "debugger;" statement had no effect. I ensured my code is being executed by inserting an error next to that statement and it was correctly reported by Firefox.

I checked the port specified in Komodo so it matches Firefox and I tried both 9000 and 9050 to make sure the port wasn't the problem. I turned off my firewall and virus checker too.

I did get one debugging session to work when I first installed Komodo and Firefox but since then a number of attempts have failed.

-->