nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.27k stars 3.89k forks source link

--remote-debugging-port=9222 fails #8191

Closed pragma-git closed 1 month ago

pragma-git commented 2 months ago

Bug

Current/Missing Behavior

Running nwjs sdk with --remote-debugging-port fails to show up in Chrome url = http://localhost:9222/

The possibility to connect with Chrome is greatly missed, since this was my go-to way if the GUI failed to load.

Expected/Proposed Behavior

Opening in Chrome with http://localhost:9222/ used to work (see test with 0.49 below).

Additional Info

stepancar commented 2 months ago

We experience the same issue

animanathome commented 2 months ago

We have the same issue with 0.88 and 0.87 on ubuntu22.04

stepancar commented 2 months ago

I have to mention. We have experienced the same issue on 88, 87, 86. but not on 85. We are running nwjs on linux

ayushmanchhabra commented 1 month ago

Steps to reproduce:

  1. Run nw with manifest configured as below (add the --user-data-dir flag after reading this article)
{
    "name": "<any name>",
    "main": "<any html or js file",
    "chromium-args": " --user-data-dir=/home/<user>/testing --remote-debugging-port=http://localhost:9222/"
}
  1. Open Chrome and navigate to http://localhost:9222.

  2. Observe message which says Site can't be reached and localhost refused to connect.

pragma-git commented 1 month ago

I got it to work on MacOS nwjs SDK versions v85 and v89, following above comments and mentioned links.

AS BEFORE:

1) Start as before (in this example, I stand in the folder containing package.json): /Applications/nwjs.app/Contents/MacOS/nwjs --remote-debugging-port=9222 .

NEW:

2) Open Chrome browser, and type address chrome://inspect/

3) Click the top-most inspect link on the screen shot. You may have to resize panes to get it looking as before

Screenshot connect to remote



SUGGESTION:

May I suggest to add a helpful hint on how to connect with chrome, in the documentation https://docs.nwjs.io/en/latest/For%20Users/Debugging%20with%20DevTools/ ?

ayushmanchhabra commented 1 month ago

https://developer.chrome.com/docs/devtools/remote-debugging/local-server/ Article detailing port forwarding