SublimeWebInspector
SublimeWebInspector copied to clipboard
Can't add breakpoint
I can get chrome to open and start debugging and I have the console working, but when I try to add a breakpoint nothing happens.
I have the following errors in the bottom console window:
[4560:2672:0318/093557:ERROR:connection.cc(730)] sqlite error 19, errno -2: PRIMARY KEY must be unique [4560:6612:0318/093602:ERROR:textfield.h(162)] NOT IMPLEMENTED
Thanks for your hard work, this could potentially be hugely useful.
Please see #11
I'll try a simple project, my problem is on Windows 8 btw
Ok I've tried a very simple project and it still doesn't add breakpoints, any other ideas?
Hmm when I tried before I was using jQuery from Google's CDN, I downloaded it and breakpoints now work.
Does every single script have to be loaded locally, even if you aren't interested in debugging it? If so is there a way around this? I don't always have every script locally on my machine, and I often use the SFTP package to upload to servers etc.
Hmm this sound strange. Can you send me a sample project where breakpoints doesn't work?
Here is the example using the Google jQuery CDN - https://dl.dropbox.com/u/3615425/web_inspector_test.zip
I'm using Windows 7 and absolutely nothing happens when I use the Add/Remove Breakpoint command.
I'm on Windows 7 also. Breakpoints work in a simple project, where scripts are included with <script>
tags. In a more complex application using RequireJS the Add/Remove Breakpoint command does nothing, as reported by @joezimjs.
@bbeckford you have error in your htm file src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"
I fixed it and run from local server on path 'http://localhost/adminui/web_inspector_test/index.htm'
and everything works fine!
@fencliff could you provide a sample project with RequireJS
@sokolovstas, silly me!
However, it seems in my testing any javascript error will mean I can't add a breakpoint. For example I have a dev site that shows an error due to no linked in api key being set, something I usually ignore whilst I'm building and debugging the rest of the site but would stop me from using web inspector, is this repairable?
Thanks
@bbeckford please provide more details:
- what URL entered in browser
- what URL of debugging file
- what folder added to sublime project
- what local file name
I believe this is simple file and path errors. Also you can try close tab, open again and then connect inspector.
For now now matching algorithm is:
- Take file url -> "https://github.com/sokolovstas/SublimeWebInspector/issues/17.JS"
- Delete first http and host -> "sokolovstas/SublimeWebInspector/issues/17.JS"
- Try open file by path "sokolovstas/SublimeWebInspector/issues/17.JS"
- If can't find remove step by step from url parts splitted by "/"
- Try open file by path "SublimeWebInspector/issues/17.JS"
- Try open file by path "issues/17.JS" and so on
@sokolovstas, I created a repro which shows that the issue was not in RequireJS script loading after all. The problem appears to be that the root folder opened in Sublime Text was the one "above" the web page root, so that my source url in the browser was /file.js
, whereas the path in Sublime was /source/file.js
. The issue was solved by only opening the source
directory in Sublime. This is slightly inconvenient, but definitely manageable.
This project is awesome. Thanks for all the good work!
You must have at lease one folder with all content because plugin search for files in project folders!
@bbeckford I can close issue? All works fine?
OK so I have several instances where this isn't working, in different ways.
1: No errors given by the plugin. Just nothing was happening. In this case I had an error in the script, which was why it wasn't setting a breakpoint. This is bad because when I have errors, I'm more likely to WANT to use a breakpoint to try to figure it out.
2: Similar issue to @fencliff I believe. My project structure looks like this (the structure is the same in #1): Main Folder |-- public | |-- js ........
So the browser's root folder (/) is "public". In this case I get this error in the little console below the inspector: [8196:6920:0320/073456:ERROR:external_registry_loader_win.cc(103)] File C:\Program Files (x86)\OApps\chromeaddon.crx for key Software\Google\Chrome\Extensions\kincjchfokkeneeofpeefomkikfkiedl does not exist or is not readable.
3: Just for kicks, I made "public" the root of the project and tried debugging. If the error that I mentioned in #1 is there, it'll let me put the breakpoint, but when I refresh the browser or do anything, it skips right past the breakpoint. Completely useless.
If I fix the error, stop debuggin, start debugging again, try setting a breakpoint, I get a popup error saying "Could not resolve breakpoint".
So basically, I've tried everything mentioned in this issue and still nothing works for me.
@joezimjs Please provide sample project and path where to place it on localhost. I can't find bugs by description only. I need to test something.
PS I have fixed some issues with setting breakpoints on ST3 branch today.
https://github.com/joe-zim-javascript-blog/ButlerBoss is the project
when you run node butlerboss
it'll start up the server on localhost:8080
Ok I have fixed path issue, now file mapping working fine. Where to try set breakpoint?
I was just trying to set it in the main.js file.
On what line? If on 8 line, there I have Exception and Javascript just falling and breakpoints not work here. But in new version I made a new property "pause_on_exceptions" and it set to "uncaught" if you have uncaught exception debugger will pause there
Set a breakpoint anywhere that would normally work. If it works, great; if it doesn't then we'll have to figure it out.
And debugger paused on line 4, 10, 7, 7 and uncaught Exception and stop
Is your latest version available through the Package Installer?
Yes, you use sublime 3? You need just restart sublime and packages will be updated
No I'm on Sublime 2
Right now I'm getting this in the console:
[14268:11872:0321/074231:ERROR:external_registry_loader_win.cc(104)] File C:\Program Files (x86)\OApps\chromeaddon.crx for key Software\Google\Chrome\Extensions\kincjchfokkeneeofpeefomkikfkiedl does not exist or is not readable. [14268:14272:0321/074236:ERROR:textfield.h(162)] NOT IMPLEMENTED
That's just after trying to start Chrome. Nothing really works after that.
I have changed path from version to branch need to wait until wbond package manager reload package.
I'm not sure what that means. I should just wait?