-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger breakpoints using incorrect URL for a remote debugging session and therefore failing to pause the process #103
Comments
Also referenced on https://bugs.chromium.org/p/chromium/issues/detail?id=841697 |
Thanks for great report! Inside V8 on inspector backend side we try to match breakpoint url and script url. In this case we send incorrect url from frontend side and when we receive new parsed script on backend side we do not set breakpoint properly. I will do following two points next week:
I will update this issue as soon as I get some results. (PhpStorm actually uses great regexp) |
Just to corroborate that this is due to a change on the chrome side and provide a workaround. We experienced this recently running windows workstations with a linux development VM. We had 3 versions of chrome(64, 66, 68) connecting one at a time to a debug session and only 64 was working normally. This was true for node 6, 8 and 10. As a workaround for those who need to debug, we found that using the id and manually visiting the link |
I'm experiencing the lack-of-breakpoints with Windows 10 + WSL (aka Ubuntu Bash for Windows) + Node 8.11.3 @mathieulj 's workaround by manually building the Thanks for the help guys this was driving me bonkers for a while :D Node v8.11.3 |
Also mentioned in the chromium bug, Chrome Extensions "Inspector Manager" is a simpler workaround for now https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj |
@ak239 is there any progress being made with this issue? Unfortunately, [Web/PHP]Storm has it's own issues with simply choosing the first file it sees with the name the breakpoint is set against. In the case of files named |
I landed following CL recently. It should fix provisional breakpoints in Node.js targets. At least it helps ndb. |
I downloaded the canary with version: Version 70.0.3508.0 (Official Build) canary (64-bit) and it appears to still have the same problem if that helps. |
It seems to have gotten worse with the release of chrome 69. The workarounds I posted above no longer work with chrome 69.0.3497.81(stable) and with chrome 71.0.3548.0 (canary). Workstations still running 68.0.3440.106 do work with both workarounds. |
For those with a Webstorm licence, version 2018.2.3 seems to break correctly on breakpoints. |
For those without a WebStorm licence you can use the Early Access Programme (EAP) builds for free with the following notice:
NOTE: I am not affiliated with JetBrains |
The root of this issue is using platform-specific file paths in our protocol as was mentioned before. I landed V8 patch and close to merging Node patch that will migrate Node starting Node 11 to file urls: nodejs/node#22251. |
fileURL patches were merged to Node 10. So I expect this issue to be fixed in next Node 10 release, I will update this bug when release happens. |
@ak239 Will this be updated for node 8 at well? As I just recently encountered the bug after Chrome updated XD |
The most recent version of NiM actually does work as a fix to this. Different DevTools versions can be selected along with a custom version as the video shows. https://youtu.be/hjf6esnqOJQ So in essence when using NiM it doesn't matter which version of Node or Chrome you use. |
@june07 ?I'm using NiM 1.1.0, Node 10.12 (remote, linux), Chrome (69, windows) and I still get this problem |
You need to change the DevTools version under NiM settings...
…On Fri, Oct 12, 2018, 8:41 AM Scott Donnelly ***@***.***> wrote:
@june07 <https://github.com/june07> ?I'm using NiM 1.1.0, Node 10.12
(remote, linux), Chrome (69, windows) and I still get this problem
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#103 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK099hKyPKXOBT0d5avdzEfaKwUHigwkks5ukLgagaJpZM4UNjlM>
.
|
@june07 thanks for the quick response. I'v tried changing NiM settings but it is not clear what to use for the value of custom devtools. I have tried a few values but none work, and now if I try to turn off "use alternate devtools", it does not open an inspector at all. |
Strange, just upgraded from 2018.1 to 2018.2, but doesn't change anything here. Also tried the 2018.3, but still not hitting any breakpoint. Using NiM turned out to work, but it doesn't work as sweet as the Webstorm debugger. |
I've just tried NiM 1.1.0 with Node 10.12 and Version 69.0.3497.100
(Official Build) (64-bit) and can confirm that:
https://chrome-devtools-frontend.appspot.com/serve_file/@a10b9cedb40738cb152f8148ddab4891df876959/inspector.html
works. Which is the appspot option.
[image: Mailtrack]
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality6&>
Sender
notified by
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality6&>
10/12/18,
12:31:15 PM
…On Fri, Oct 12, 2018 at 12:24 PM Stephan Meijer ***@***.***> wrote:
For those with a Webstorm licence, version 2018.2.3 seems to break
correctly on breakpoints.
Strange, just upgraded from 2018.1 to 2018.2, but doesn't change anything
here. Also tried the 2018.3, but still not hitting any breakpoint.
Using NiM turned out to work, but it doesn't work as sweet as the Webstorm
debugger.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#103 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK099oAGrx5HcpX-hvgBJjehy6nbJkGcks5ukOx1gaJpZM4UNjlM>
.
|
Okay, let me rephrase that. WebStorm does kind of work. Some breakpoints can be hit, other ones not at all. And others don't seem to be hit, but my frontend does block. So node is pausing and waiting for the debugger, but I don't have control over it. So I basically have 3 types of breakpoints.
|
@ak239, Should I assume that Node 8 will not be supported? I've just tried NiM 1.1.0 with devtools set to: https://chrome-devtools-frontend.appspot.com/serve_file/@a10b9cedb40738cb152f8148ddab4891df876959/inspector.html on Node 8.11.3 and Version 69.0.3497.100 |
I definitely would like to get if fixed, but I need your help. |
I literally just setup my environment to match yours and confirmed again that things are working with NiM. Maybe you'll see some changes between our environments from the video? |
Could we focus on fixing DevTools and DevTools protocol in this issue please? A lot of workarounds were already mentioned and I believe that now we can focus on finding solution for root issue. |
I had the devtools set correctly but failed to turn them on, D'oh. When I use it now, I notice that the debug console uses v66 of chrome and all works as expected. |
Looks like canary (v72) fixes the problem! (at least for me). EnvironmentWindows 10: Version 1803 (OS Build 17134.345) Note: I am running WSL on windows, which is the Ubuntu linux subsystem. node script index.js:1 console.log('hello World');
2
3 console.log('Hit 1?');
4 debugger;
5 console.log('Hit 2?'); Repro steps
Fails with chrome 69, tested with node 8.11.3 & node 10.12Result: debugger stops on line 4, missing breakpoint at line 3. Workaround with NIM tools works because essentially it uses v66 of the devTools. Verified fixed with chrome 72, tested with node 8.11.3 & node 10.12Result: debugger stops on breakpoint at line 3 |
Actually updated NiM (1.2.0) to use the most up to date version of DevTools (Chrome 71) as well as adding info on how to better use the custom setting https://june07.com/blog/nim-custom-devtools-url. @ak239 This will be my last post to this thread. Cheers. |
Ignore?This may be expected behavior. Before I can set a breakpoint on a required file, the file has to be loaded. Sorry for the clutter. Entered issueOops! spoke too soon. devTools fails to stop on a breakpoint in a required module. EnvironmentWindows 10: Version 1803 (OS Build 17134.345) Note: I am running WSL on windows, which is the Ubuntu linux subsystem. node script index.js:1 let foo = require('./foo');
2 console.log('hello World');
3 foo(); node script foo.js1 function foo() {
2 console.log('Hit 1?');
3 debugger;
4 console.log('Hit 2?');
5 }
6
7 module.exports = foo; Repro steps
Result: devTools fails to stop on the breakpoint, stops on Workaround
Result: devTools will now stop on both breakpoints. |
On Chrome/Chromium v69, UI breakpoints (not debugger statement) doesn't work anymore since node v10. |
I verified that Chrome release version: |
I confirm that Chrome |
I'm using v8 8.0.426 and am still seeing this issue with the latest Chrome and VS Code. Installing NiM did fix the problem on the mac, but not on windows (though, I'm not convinced NiM is correctly installed on windows because I'm not seeing the syntax coloring). I did verify that all of my paths are correctly specified within the v8::ScriptOrigin. Here's an example: Ticks = 23110 <17356> <5> messageFromDebugger : /1, payload : {"id":17,"method":"Debugger.setBreakpointByUrl","params":{"urlRegex":"[Dd]:\\dev\\apd\\<...redacted...>\.js|file:\/\/\/[Dd]:\/dev\/apd\/<...redacted...>\.js","lineNumber":430,"columnNumber":13}} |
What version of DevTools, NiM, and Node.js are you running on Windows? |
Node.js v12.16.3 Note, I've embedded v8 into a desktop application directly. Updating Node.js yesterday helped resolve one of my problems on windows, but I'm still seeing the same problem within VSCode. In the failure case, I'm unable to step into some functions that are in other .js files. |
@louderspace If you are embedding V8 directly, your ScriptOrigin might contain properly formed file URLs like file://... - in this case, everything should work out of the box. The solution that was implemented on the DevTools side only works for Node.js. So how do you start DevTools to debug your embedded V8? |
I am setting the script origins: Added tracing shows "SetScriptPath = D:\dev\p4<redacted>\nml\nml_include.js Should this be in the form file://dev/... ? |
I tried various flavors and haven't had any success: CompileAndRun script : file:///D:/dev/p4/nml/nml_include.js I do have NiM working on windows now and running Chrome 8.3 |
Symptoms
This is related to the closed ticket #99, which describes the symptoms of this very problem.
You set a breakpoint, but the process isn't paused when that breakpoint is encountered and carries merrily on.
Environment
This is a remote debugging session between a Windows client (running Chrome devtools) and a remote Linux server (running node with
--inspect=0.0.0.0
).What's wrong
By watching the websocket communication with Wireshark it is apparent that the Chrome Dev tools are using an incorrect filepath/URL when calling
Debugger.setBreakpointByUrl
.What I am seeing
Request
Response
Note the empty locations array. I am no node debugger expert, but it feels like this locations array should be checked to ensure it is not empty after setting a new breakpoint marker before then showing the marker as active in the UI.
What I should be seeing
Request
Response
Note the Linux path separators instead of Windows and the initial root slash on the path.
But isn't this a node bug?
No, it is not from what I can tell because of the following two discoveries.
PHPStorm
PHPStorm/WebStorm debugger continues to work just fine using it's URL regexes
Request
Response
Manually recreating the request successfully
If I manually set the breakpoint myself I see a success response back over the websocket. For example consider the following code run from the Chrome console:
Which gives us this when run in the Chrome console
Possible introduction of the issue
https://chromium.googlesource.com/chromium/src/+/2140ffeadf3e081e2e0821fc8e1ee040373b205d%5E%21/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
in combination with https://chromium.googlesource.com/chromium/src/+blame/master/third_party/blink/renderer/devtools/front_end/common/ParsedURL.js#103
The text was updated successfully, but these errors were encountered: