Version: 6.9.1 and 7.0
Platform: Windows 7 x64 (Chrome 54.0.2840.71 m)
Subsystem:
test.js with console.log("Hello World");node --inspect --debug-brk test.jsOn the console tab, I don't see any input field. When I press escape and open the smaller console tab, I have suggest for input, but I can't execute code.
The latter works when I change the URL query param from ws=localhost:9229/node to ws=127.0.0.1:9229/node
I made a small video to display the problem that I have been facing.
This is not a Node.js bug but a Chrome DevTools issue.
@eugeneo Shall I post it at bugs.chromium.org ?
Yes, please. Can you also try Node 7 - either nightly build or build from the sources? It uses newer devtools, the bug might not be reproducible there.
Sure, I can try from the nightly build it in an hour and will post my results here. I'm a meagre front end developer so I might not be able to build it myself from the sources.
@eugeneo Yep! The console is working fine in the v8.0.0-nightly201610310e92bb99c6 release. I can see the blue arrow and the input box.
But one original problem which was also there in the previous issue still remains which is that I need to replace localhost with 127.0.0.1 otherwise the console would not print statement.
For example the URL
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:9229/0bd7
6823-b73d-4b59-b4c0-aac52bbbb0a5`
Becomes
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/0bd7
6823-b73d-4b59-b4c0-aac52bbbb0a5`
This sounds like something odd in Windows networking - so it has to be looked into.
I tried digging around a bit more on this issue. I'm using this plugin called Inspect Process.
It tries to read the debugger URL and launch debug tools in a new process (Source). I was expecting the console to work when I replaced localhost with 127.0.0.1 and launch the process. But it still doesn't work and I face the same problem.
The only way I could see this working is when I manually open Chrome and then paste the debug URL replacing localhost with 127.0.0.1.
I now feel maybe there is something wrong with my Windows itself or my copy of Chrome so today I will create a fresh Windows 7 VM and then try it inside the VM and report it here.
@eugeneo tried it inside a new Windows VM
everything worked perfectly fine for the first time. And then from the second time onwards the same problem reflects, i.e using 127.0.0.1 instead of localhost
Looks like some Windows7 setups are not able to resolve localhost. This can either be addressed with changing the Windows setup or by using 127.0.0.1 as a host name.
@eugeneo Thanks for pushing the localhost -> 127.0.0.1 change. Do you know when does it normally get merged into the nightly build?
Also, one last question about localhost not resolving on Windows 7 setups. Did you mean the resolution is setting up the line 127.0.0.1 localhost inside the system32/drivers/etc/hosts file? Because that doesn't work either.
However localhost in the browser points to the webserver if it's running.
@atif089 I have never being able to reproduce this problem as it seems like some pecularity with Windows7 setups and/or specific network environments. Some browsers might be using different resolution facilities so the results may differ ever so slightly.
Right now I need to wait 48 hours before actually submitting this patch (there might be some issues that I have not thought about so I would like other Node contributors take a look). So it should be in by the Tuesday build.
@eugeneo Weird part is that I use this plugin called inspect-process which uses chrome driver and only launches an instance of DevTools.
I changed it's source to replace localhost with 127.0.0.1 so that it looks like this
proc.stderr.on('data', (data) => {
let dataStr = data.toString();
const isListening = dataStr.startsWith('Debugger listening on port');
const isAttached = dataStr.startsWith('Debugger attached');
const isComplete = dataStr.startsWith('Waiting for the debugger to disconnect');
if (isListening) {
dataStr = dataStr.replace("localhost", "127.0.0.1");
return devtools.open(dataStr.substring(dataStr.indexOf('chrome-devtools')));
} else if (isComplete) {
The problem still exists.
But if I manually open Google Chrome and then paste that link with 127.0.0.1, it works.
Video -> https://www.youtube.com/watch?v=0mll_sCzSAI
I posted this because maybe it might not work even after your last commit due to this problem.
Quickly tested on a Windows 8 and Windows 10 VM. And it exists there too. I also see this error in console
[2744:7908:1104/003631:ERROR:CONSOLE(1)] "Uncaught ReferenceError: DevToolsAPI is not defined", source: (1)
[2744:7908:1104/003631:ERROR:CONSOLE(4461)] "Request Log.enable failed. {"code":-32601,"message":"'Log.enable' wasn't found"}", source: chrome-devtools://devtoo
ls/bundled/inspector.js (4461)
Hi @eugeneo,
I tried using Visual Studio Code's debugger last weekend and it seems to work without any problem. Does it work differently than the Chrome's debug tools?
Probably they are not using "localhost" - just the IP address.
On Mon, Nov 7, 2016 at 2:55 AM Mohammed Ameenuddin Atif <
[email protected]> wrote:
Hi @eugeneo https://github.com/eugeneo,
I tried using Visual Studio Code's debugger last weekend and it seems to
work without any problem. Does it work differently than the Chrome's debug
tools?—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/nodejs/node/issues/9382#issuecomment-258805534, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AARkrWcwk4ON9QKAsRFbKX7iOaeEMjiGks5q7wOegaJpZM4KlNjB
.
Most helpful comment
@eugeneo Yep! The console is working fine in the
v8.0.0-nightly201610310e92bb99c6release. I can see the blue arrow and the input box.But one original problem which was also there in the previous issue still remains which is that I need to replace
localhostwith127.0.0.1otherwise the console would not print statement.For example the URL
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:9229/0bd7
6823-b73d-4b59-b4c0-aac52bbbb0a5`
Becomes
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/0bd7
6823-b73d-4b59-b4c0-aac52bbbb0a5`