Webstorm 2020.2.1 Remote Debugging do not work

Webstorm 2020.2.1 only opens a about:blank page, if i want to debug my angular application. After a while i get this error message:

Waiting for connection to localhost:52421. Please ensure that the browser was started successfully with remote debugging port opened. Port cannot be opened if Chrome having the same User Data Directory is already launched.

Thats correct on Windows 10 i cannot find any open port 52421 on any started chrome instance using netstat -ano. I only see the SYN_SEND from my webstorm instance. My guess the chrome instance is not started with the --remote-debuging-port option. What i have tried so far:

Changed the path directrly to chrome.exe under Tools -> Web Browsers. Add the remote-debugging-port option manually with port 52421 and used another chrome-user-data folder. Start the IDE as administrator. Without any effect. Chrome always starts with a blank page and i am unable to debug anything.

2020-08-28 10:12:16,546 [ 25] INFO - #com.intellij.idea.Main - IDE: WebStorm (build #WS-202.6948.73, 25 Aug 2020 10:11)
2020-08-28 10:12:16,547 [ 26] INFO - #com.intellij.idea.Main - OS: Windows 10 (10.0, amd64)
2020-08-28 10:12:16,547 [ 26] INFO - #com.intellij.idea.Main - JRE: 11.0.8+10-b944.31 (JetBrains s.r.o.)
2020-08-28 10:12:16,547 [ 26] INFO - #com.intellij.idea.Main - JVM: 11.0.8+10-b944.31 (OpenJDK 64-Bit Server VM)

...

2020-08-28 10:12:21,376 [ 4855] INFO - .diagnostic.PerformanceWatcher - Post-startup activities under progress took 751ms; general responsiveness: ok; EDT responsiveness: 1/1 sluggish
2020-08-28 10:12:21,384 [ 4863] INFO - cloudConfig.CloudConfigManager - === StatusBar.start create ===
2020-08-28 10:12:21,492 [ 4971] INFO - tor.impl.FileEditorManagerImpl - Project opening took 3519 ms
2020-08-28 10:12:21,704 [ 5183] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 251ms; general responsiveness: ok; EDT responsiveness: ok
2020-08-28 10:12:22,054 [ 5533] INFO - .diagnostic.PerformanceWatcher - Pushing JS language level to 115 libraries took 1308ms; general responsiveness: ok; EDT responsiveness: 1/2 sluggish
2020-08-28 10:12:22,793 [ 6272] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 1088ms; general responsiveness: ok; EDT responsiveness: ok
2020-08-28 10:12:22,798 [ 6277] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 0 files to index
2020-08-28 10:12:26,534 [ 10013] INFO - gnostic.WindowsDefenderChecker - Windows Defender status: not used
2020-08-28 10:12:27,631 [ 11110] INFO - ion.PackageVersionRangeMatcher - Matching 61 done in 208 ms
2020-08-28 10:12:30,949 [ 14428] INFO - tellij.xml.Html5SchemaProvider - HTML5_SCHEMA_LOCATION = C:/Program Files/JetBrains/WebStorm 2020.2.1/lib/intellij-xml.jar!/resources/html5-schema/html5.rnc
2020-08-28 10:12:36,982 [ 20461] INFO - .script.IdeScriptEngineManager - javax.script.ScriptEngineManager initialized in 114 ms
2020-08-28 10:13:09,536 [ 53015] INFO - m.pty4j.windows.WindowsVersion - Windows version: 10.0.19041
2020-08-28 10:13:16,172 [ 59651] INFO - sole.jcef.JCEFConsoleHtmlPanel - WebConsole page loaded
2020-08-28 10:13:16,176 [ 59655] INFO - .console.WebConsoleHistoryView - WebConsole page initialization complete
2020-08-28 10:13:16,176 [ 59655] INFO - sole.jcef.JCEFConsoleHtmlPanel - initialization complete
2020-08-28 10:13:27,763 [ 71242] INFO - rowsers.BrowserLauncherAppless - Timed out
2020-08-28 10:13:27,763 [ 71242] INFO - rowsers.BrowserLauncherAppless - [20016:20400:0828/101317.874:ERROR:tcp_socket_win.cc(352)] bind() returned an error: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig. (0x271D)
[20016:20400:0828/101317.875:ERROR:tcp_socket_win.cc(352)] bind() returned an error: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig. (0x271D)
[20016:20400:0828/101317.875:ERROR:devtools_http_handler.cc(298)] Cannot start http server for devtools.

2020-08-28 10:24:25,062 [ 728541] INFO - sole.jcef.JCEFConsoleHtmlPanel - WebConsole page loaded
2020-08-28 10:24:25,063 [ 728542] INFO - .console.WebConsoleHistoryView - WebConsole page initialization complete
2020-08-28 10:24:25,063 [ 728542] INFO - sole.jcef.JCEFConsoleHtmlPanel - initialization complete
2020-08-28 10:27:45,332 [ 928811] INFO - j.ide.actions.RevealFileAction - Exit code 1
2020-08-28 10:30:10,126 [1073605] INFO - sole.jcef.JCEFConsoleHtmlPanel - WebConsole page loaded
2020-08-28 10:30:10,127 [1073606] INFO - .console.WebConsoleHistoryView - WebConsole page initialization complete
2020-08-28 10:30:10,127 [1073606] INFO - sole.jcef.JCEFConsoleHtmlPanel - initialization complete
2020-08-28 10:30:23,348 [1086827] INFO - rowsers.BrowserLauncherAppless - Timed out
2020-08-28 10:30:23,348 [1086827] INFO - rowsers.BrowserLauncherAppless - [18796:12556:0828/103013.456:ERROR:tcp_socket_win.cc(352)] bind() returned an error: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig. (0x271D)
[18796:12556:0828/103013.456:ERROR:tcp_socket_win.cc(352)] bind() returned an error: Der Zugriff auf einen Socket war aufgrund der Zugriffsrechte des Sockets unzulässig. (0x271D)
[18796:12556:0828/103013.456:ERROR:devtools_http_handler.cc(298)] Cannot start http server for devtools.

 

Any further advice?

4

Looks like a permissions issu on opening a socket (similar to https://appuals.com/fix-an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-permissions/). Seems that some certain dynamic port numbers are blocked by a firewall/proxy/etc.
Does the issue persist after IDE restart/system reboot? If yes, please try shutting down the IDE and then removing both ~\AppData\Roaming\JetBrains\WebStorm2020.2\options\web-browsers.xml and ~\AppData\Roaming\JetBrains\WebStorm2020.2\options\other.xml files - does the issue persist?

12

Elena you are awesome! Deleted these two files and everything is working as expected! Amazing. Thank you very much!

3

Using Rider, I only have other.xml, and this fix works. It did twice!

1

Deleting other.xml worked for me too.  Thanks Lucas K for well described issue and Elena for giving clear fix.

1

I had no web-browsers.xml file.  Deleting the other.xml file worked for me too.  It was at C:\Users\jhouser\AppData\Roaming\JetBrains\IntelliJIdea2020.3\options

 

Edit:  Almost worked.. now I need a debugger statement in the code or else the IntelliJ debugger will never pick up on breakpoints.  Once the first debugger statement is triggered; breakpoints work as expected.

How weird' I would have sworn this worked w/o issue last week.

 

0

I am facing same issue for IntelliJ Idea. I tried to delete the files mentioned above but it did not work.

Should I do anything else for IntelliJ Idea ?

0

Thank you, Elena, it worked for me.

0

I just removed the property "js.chrome.debugger.port..." and "last_opened_file_path" from other.xml and that was enought.

1

FYI - worked for me as well on WebStorm 2021.1.2 (and only other.xml)

 

0

i deleted other.xml and web-browsers.xml but  not working.

 

(i m using ubuntu )

 

this my event log

Waiting for connection to localhost:40079.
Please ensure that the browser was started successfully with remote debugging port opened.
Port cannot be opened if Chrome having the same User Data Directory is already launched.

 

0

Most probably the next auto-generated port number doesn't work for you as well

If you are sure that the port 40079 is not occupied by the other app/blocked by firewall, you can check if it's excluded from the dynamic ports range using netsh interface ipv4 show excludedportrange protocol=tcp and then replace the 40079 port with some port valid on your system in other.xml

1

i don't understand how to do this

Waiting for connection to localhost:45261. Please ensure that the browser was started successfully with remote debugging port opened. Port cannot be opened if Chrome having the same User Data Directory is already launched.

0

What problems doing this have you faced?

0

as far as I can see, you are using the wrong configuration for debugging; npm start runs react-scripts start, running it in debugger makes no sense unless you'd like to debug the react-scripts; you need using JavaScript Debug run configuration to attach the debugger to your page.

  • create a JavaScript Debug run configuration with your app URL
  • run the npm start to build your app and start the dev server
  • debug the JavaScript Debug run configuration above

Please see https://www.jetbrains.com/help/webstorm/2021.1/react.html#react_running_and_debugging_debug for instructions on debugging React applications

0

>Waiting for connection to localhost:45261

if closing all chrome instances prior to starting the debugger doesn't help, please try the steps from https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009567459/comments/4406239534354 above

>then i see in chrome

 

do you mean that you can see Apache web server start page if you open localhost:3000 in browser? It's strange, as the run console shows that the React dev server is started on this URL... Anyway, this problem is not related to debugging

0

>When you press the link that appears in the picture with CTRL+SHIFT+CLICK. Apache2 Ubuntu Default Page opens in a new Chrome tab

this means that the Apache server is listening on http://192.168.0.20. This, again, has nothing to do with debugging

>I don't understand how to do it here

what is unclaer namely?

0

Anyway, I gave up on debug.
I can not.
Thank you for your interest

0

I am facing the same problem with a freshly installed WebStorm 2021.3.2 on macOS Monterey 12.1. When I try debugging a new instance of Chrome gets opened on the about:black page and after a few seconds I get the following message in PyCharm:

Waiting for connection to localhost:49680. 
            Please ensure that the browser was started successfully with remote debugging port opened. 
            Port cannot be opened if Chrome having the same User Data Directory is already launched.

I have tried deleting the two .xml files you mentioned. I have restarted the IDE and rebooted the machine, but nothing helps. What could I do? Thanks.

0

Found the problem, for me it was having added these two lines in WebStorm.app.vmoptions

-Djava.net.preferIPv4Stack=false
-Djava.net.preferIPv6Addresses=true

Removing them made the debugger work.

1
After I removed the other.xml file other.xml I have a problem
 
I put a debugger in the JS code, I start the debugging process in rider, a new browser window opens and when I call breakpoint from the UI, my application stops in the browser, but nothing happens in the debugger tab(Rider IDE).
When I press F12 I see that the application is stopped at a breakpoint.
Can you help me? 
 
Update: Rider seems to have a bug. The Debugger tab starts working by itself. After 15-20 minutes or when changing any "JavaScript Debug" settings in "Edit configuration"
0

If you are running WebStorm on CentOS and you have reached the current page by an Internet search like "WebStorm Could not initialize class com.intellij.javascript.debugger.console.jcef.JCE", you might have searched for the following workaround for a CentOS problem:

Add ide.browser.jcef.enabled=false in Help | Edit Custom Properties, then restart the IDE.

See https://vocon-it.com/2022/06/13/solved-webstormcentos-bug-could-not-initialize-class-com-intellij-javascript-debugger-console-jcef-jce/ for more details.

0

My problem was the Hyper-v port exclusion range. Thanks Elena Pogorelova.

0

I have the same problem, delete file works, thaks Elena Pogorelova

0

Hello, the fix did works for me also with WebStorm2021.1, but after upgrade to WebStorm2022.1 Issue persits and I am not able to find any work around !!

2023-03-09 19:43:34,950 [ 304957]   INFO - #o.j.b.BuiltInWebServer - Channel will be closed due to error
2023-03-09 19:43:36,804 [ 306811]   WARN - #c.j.d.w.WipLocalVmConnection - null
io.netty.channel.StacklessClosedChannelException
    at io.netty.channel.AbstractChannel$AbstractUnsafe.write(Object, ChannelPromise)(Unknown Source)
2023-03-09 19:43:42,455 [ 312462]   INFO - #c.i.a.o.PathMacrosImpl - Saved path macros: {}
2023-03-09 19:43:43,034 [ 313041]   INFO - #c.i.c.ComponentStoreImpl - Saving appEditorSettings took 16 ms, GeneralSettings took 16 ms, NodeJsLocalInterpreterManager took 15 ms, PluginAdvertiserExtensions took 32 ms, TemplateSettings took 15 ms, editorConfigEncodings took 532 ms
2023-03-09 19:43:44,002 [ 314009]   INFO - #c.i.o.c.i.s.StoreUtil - saveProjectsAndApp took 1609 ms
2023-03-09 19:47:22,316 [ 532323]   INFO - #c.i.i.a.RevealFileAction - Exit code 1
2023-03-09 19:47:22,765 [ 532772]   INFO - #c.i.c.ComponentStoreImpl - Saving appActionsLocalSummary took 15 ms, RunnerLayoutSettings took 16 ms
2023-03-09 19:47:22,796 [ 532803]   INFO - #c.i.c.ComponentStoreImpl - Saving Project(name=react, containerState=COMPONENT_CREATED, componentStore=C:\git_clones\easydoct\Dev\EasyDoct.Fo\js\react)ServiceViewManager took 16 ms
2023-03-09 19:47:39,641 [ 549648]   INFO - #c.i.u.WinFocusStealer - Foreground lock timeout set to 200000
2023-03-09 19:47:39,762 [ 549769]   INFO - #c.i.u.WinFocusStealer - Foreground lock timeout set to 0
2023-03-09 19:47:40,617 [ 550624]   WARN - #c.i.j.d.c.j.JCEFConsoleHtmlPanel - Failed to load http://localhost:63342/a03365f2-eea1-451a-ad19-6dae9187a990/frontend/console.html?internal=false
Err ERR_ABORTED: ERR_ABORTED

Any tips ? 

0

Tried with Edge Browser and its working well !!!

 

 

 

0

Igolus it must be a problem introduced by recent Chrome update. Chrome 111.* rejects the requests unless started with --remote-allow-origins=*; the fix is available in 2023.1 Beta. See https://youtrack.jetbrains.com/issue/WEB-59211/Cant-attach-debugger-to-Chrome-Dev-111-Invalid-handshake-response-getStatus-403-Forbidden

4

Elena Pogorelova I was pulling my hair out when my debugger suddenly stopped working and moving to the 2023.1 beta fixed the issue

0

I have the same problem. Switching to 2023.1 didn't solve this issue for me. Before with 2022.3 chrome was opened with a new window and address "about:blank" and Jetbrains didn't recognize the connection to the browser. Now with 2023.1 Chrome opens with address "localhost:4200" (that is the correct address), but it only shows the loading spinner and a white page. I'm using Chrome 111.0.5563.64 (Official Build) (arm64). I even can't open the web dev tools. The page seems to be unresponsive.

Is there any workaround?

EDIT: I found a solution: You have to deselect the option "Ensure breakpoints are detected when loading scripts" option in Run/Debug Configurations -> <your Javascript Debug configuration>

2

We aren't aware of such issues in 2023.1; please file a new ticket to youtrack, https://youtrack.jetbrains.com/issues/WEB, attaching the idea.log and a screenshot of your JavaScript Debug run configuration

0

请先登录再写评论。