SublimeWebInspector icon indicating copy to clipboard operation
SublimeWebInspector copied to clipboard

Can't add breakpoint

Open bbeckford opened this issue 11 years ago • 58 comments

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.

bbeckford avatar Mar 18 '13 09:03 bbeckford

Please see #11

sokolovstas avatar Mar 18 '13 09:03 sokolovstas

I'll try a simple project, my problem is on Windows 8 btw

bbeckford avatar Mar 18 '13 09:03 bbeckford

Ok I've tried a very simple project and it still doesn't add breakpoints, any other ideas?

bbeckford avatar Mar 18 '13 10:03 bbeckford

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.

bbeckford avatar Mar 18 '13 10:03 bbeckford

Hmm this sound strange. Can you send me a sample project where breakpoints doesn't work?

sokolovstas avatar Mar 18 '13 10:03 sokolovstas

Here is the example using the Google jQuery CDN - https://dl.dropbox.com/u/3615425/web_inspector_test.zip

bbeckford avatar Mar 18 '13 10:03 bbeckford

I'm using Windows 7 and absolutely nothing happens when I use the Add/Remove Breakpoint command.

joezimjs avatar Mar 18 '13 15:03 joezimjs

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.

jevakallio avatar Mar 19 '13 14:03 jevakallio

@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 avatar Mar 19 '13 16:03 sokolovstas

@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 avatar Mar 19 '13 16:03 bbeckford

@bbeckford please provide more details:

  1. what URL entered in browser
  2. what URL of debugging file
  3. what folder added to sublime project
  4. 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.

sokolovstas avatar Mar 19 '13 17:03 sokolovstas

For now now matching algorithm is:

  1. Take file url -> "https://github.com/sokolovstas/SublimeWebInspector/issues/17.JS"
  2. Delete first http and host -> "sokolovstas/SublimeWebInspector/issues/17.JS"
  3. Try open file by path "sokolovstas/SublimeWebInspector/issues/17.JS"
  4. If can't find remove step by step from url parts splitted by "/"
  5. Try open file by path "SublimeWebInspector/issues/17.JS"
  6. Try open file by path "issues/17.JS" and so on

sokolovstas avatar Mar 19 '13 18:03 sokolovstas

@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!

jevakallio avatar Mar 19 '13 18:03 jevakallio

You must have at lease one folder with all content because plugin search for files in project folders!

sokolovstas avatar Mar 19 '13 20:03 sokolovstas

@bbeckford I can close issue? All works fine?

sokolovstas avatar Mar 19 '13 20:03 sokolovstas

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 avatar Mar 20 '13 12:03 joezimjs

@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.

sokolovstas avatar Mar 20 '13 13:03 sokolovstas

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

joezimjs avatar Mar 20 '13 17:03 joezimjs

Ok I have fixed path issue, now file mapping working fine. Where to try set breakpoint?

sokolovstas avatar Mar 21 '13 11:03 sokolovstas

I was just trying to set it in the main.js file.

joezimjs avatar Mar 21 '13 12:03 joezimjs

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

sokolovstas avatar Mar 21 '13 12:03 sokolovstas

Set a breakpoint anywhere that would normally work. If it works, great; if it doesn't then we'll have to figure it out.

joezimjs avatar Mar 21 '13 12:03 joezimjs

Screen Shot 2013-03-21 at 4 26 18 PM Screen Shot 2013-03-21 at 4 26 27 PM

And debugger paused on line 4, 10, 7, 7 and uncaught Exception and stop

sokolovstas avatar Mar 21 '13 12:03 sokolovstas

Is your latest version available through the Package Installer?

joezimjs avatar Mar 21 '13 12:03 joezimjs

Yes, you use sublime 3? You need just restart sublime and packages will be updated

sokolovstas avatar Mar 21 '13 12:03 sokolovstas

No I'm on Sublime 2

joezimjs avatar Mar 21 '13 12:03 joezimjs

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

joezimjs avatar Mar 21 '13 12:03 joezimjs

That's just after trying to start Chrome. Nothing really works after that.

joezimjs avatar Mar 21 '13 12:03 joezimjs

I have changed path from version to branch need to wait until wbond package manager reload package.

sokolovstas avatar Mar 21 '13 12:03 sokolovstas

I'm not sure what that means. I should just wait?

joezimjs avatar Mar 21 '13 13:03 joezimjs