Failed to load URL: http://localhost:8001/ with error: ERR_CONNECTION_RESET #876

Closed
opened 2026-01-29 16:50:57 +00:00 by claunia · 12 comments
Owner

Originally created by @nazar322 on GitHub (Apr 15, 2023).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version: 23.6.1
  • .NET: 6
  • Node: v18.15.0

After updating Electron.NET to 23.6.1 I can't no longer start my app, I have this error all the time
Got disconnect! Reason: transport close (node:16976) electron: Failed to load URL: http://localhost:8001/ with error: ERR_CONNECTION_RESET (Use electron --trace-warnings ... to show where the warning was created)
how can I add --trace-warnings to electron?
This is how I launch the app electronize start /args "--remote-debugging-port=9222" /dotnet-configuration "Release_Windows"
I have tried running it like this electronize start /args "--remote-debugging-port=9222 --trace-warnings" /dotnet-configuration "Release_Windows" but it did not change anything in the output

Originally created by @nazar322 on GitHub (Apr 15, 2023). Originally assigned to: @GregorBiswanger on GitHub. <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 23.6.1 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> * **.NET**: 6 * **Node**: v18.15.0 <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> After updating Electron.NET to 23.6.1 I can't no longer start my app, I have this error all the time `Got disconnect! Reason: transport close (node:16976) electron: Failed to load URL: http://localhost:8001/ with error: ERR_CONNECTION_RESET (Use electron --trace-warnings ... to show where the warning was created)` how can I add --trace-warnings to electron? This is how I launch the app `electronize start /args "--remote-debugging-port=9222" /dotnet-configuration "Release_Windows"` I have tried running it like this `electronize start /args "--remote-debugging-port=9222 --trace-warnings" /dotnet-configuration "Release_Windows"` but it did not change anything in the output
claunia added the bug label 2026-01-29 16:50:57 +00:00
Author
Owner

@nazar322 commented on GitHub (Apr 15, 2023):

Not a bug looks like but I have asked at Gitter and no one replied.

@nazar322 commented on GitHub (Apr 15, 2023): Not a bug looks like but I have asked at Gitter and no one replied.
Author
Owner

@nazar322 commented on GitHub (Apr 15, 2023):

image

@nazar322 commented on GitHub (Apr 15, 2023): ![image](https://user-images.githubusercontent.com/10635299/232229330-5a07daa9-d145-4942-bd22-cbbcbc3f8fbf.png)
Author
Owner

@nazar322 commented on GitHub (Apr 15, 2023):

In TCPView I see that port 8001 has been created and connected by electron.exe but a few seconds later the port gets closed and Got disconnected is shown.

@nazar322 commented on GitHub (Apr 15, 2023): In TCPView I see that port 8001 has been created and connected by electron.exe but a few seconds later the port gets closed and `Got disconnected` is shown.
Author
Owner

@GregorBiswanger commented on GitHub (Apr 15, 2023):

Do you have the Electron.NET CLI in the same version 23.6.1 also?

Delete the obj/host folder please and try again.

@GregorBiswanger commented on GitHub (Apr 15, 2023): Do you have the Electron.NET CLI in the same version 23.6.1 also? Delete the `obj/host` folder please and try again.
Author
Owner

@nazar322 commented on GitHub (Apr 15, 2023):

I have the CLI installed
image

Deleting obj/host did not help

@nazar322 commented on GitHub (Apr 15, 2023): I have the CLI installed ![image](https://user-images.githubusercontent.com/10635299/232233370-55035f79-f763-4e13-9fb1-d6a739cf95ce.png) Deleting `obj/host` did not help
Author
Owner

@GregorBiswanger commented on GitHub (Apr 15, 2023):

You can reproduce the issue in a MRE that you can give us in form of a GitHub repository (such that we only need to clone and open to see the issue appearing on our machines)

@GregorBiswanger commented on GitHub (Apr 15, 2023): You can reproduce the issue in a [MRE](https://en.m.wikipedia.org/wiki/Minimal_reproducible_example) that you can give us in form of a GitHub repository (such that we only need to clone and open to see the issue appearing on our machines)
Author
Owner

@nazar322 commented on GitHub (Apr 18, 2023):

I'm on it...

@nazar322 commented on GitHub (Apr 18, 2023): I'm on it...
Author
Owner

@nazar322 commented on GitHub (Apr 18, 2023):

I have stripped the project I am working on and that causing the problem
https://drive.google.com/file/d/1PpT-JREP-1Qp5ViJ6r568BDbIsD6df4e/view?usp=share_link

Video recording
https://drive.google.com/file/d/19wtVQj8AlSFF9rQLtjRG87e0XKNUp2NA/view?usp=share_link

You can see on the video that the splash screen (via electron.manifest.json) is shown, next it disappears but the main window is not shown + 8001 port been opened.
Ignore JIT debug pop-up, I have System.Diagnostics.Debugger.Launch(); in Main.

electronize start /args "--remote-debugging-port=9222" /dotnet-configuration "Release_Windows"
from the Frontend folder as shown in the video.

@nazar322 commented on GitHub (Apr 18, 2023): I have stripped the project I am working on and that causing the problem https://drive.google.com/file/d/1PpT-JREP-1Qp5ViJ6r568BDbIsD6df4e/view?usp=share_link Video recording https://drive.google.com/file/d/19wtVQj8AlSFF9rQLtjRG87e0XKNUp2NA/view?usp=share_link You can see on the video that the splash screen (via electron.manifest.json) is shown, next it disappears but the main window is not shown + 8001 port been opened. Ignore JIT debug pop-up, I have `System.Diagnostics.Debugger.Launch();` in `Main`. `electronize start /args "--remote-debugging-port=9222" /dotnet-configuration "Release_Windows"` from the Frontend folder as shown in the video.
Author
Owner

@GregorBiswanger commented on GitHub (Apr 18, 2023):

The first thing that strikes me is that Electron is having trouble accessing the default URL. If I want to start the frontend project alone in Visual Studio, I get error messages.

image

My tip: Remove the SPA Services and integrate Angular manually. You free yourself from this built-in dependency, which always leads to problems. You can find enough tutorials online on how to integrate Angular with ASP.NET Core WITHOUT SPA Services. As soon as the project can be run normally in the browser without electron, your example will work again with Electron.NET.

@GregorBiswanger commented on GitHub (Apr 18, 2023): The first thing that strikes me is that Electron is having trouble accessing the default URL. If I want to start the frontend project alone in Visual Studio, I get error messages. ![image](https://user-images.githubusercontent.com/7336300/232839276-2b3047f5-55c7-4faa-aa35-95e80b6ec834.png) My tip: Remove the SPA Services and integrate Angular manually. You free yourself from this built-in dependency, which always leads to problems. You can find enough tutorials online on how to integrate Angular with ASP.NET Core WITHOUT SPA Services. As soon as the project can be run normally in the browser without electron, your example will work again with Electron.NET.
Author
Owner

@nazar322 commented on GitHub (Apr 18, 2023):

@GregorBiswanger I'll try it, thanks!

@nazar322 commented on GitHub (Apr 18, 2023): @GregorBiswanger I'll try it, thanks!
Author
Owner

@GregorBiswanger commented on GitHub (Apr 19, 2023):

If you have made your changes and it still doesn't work, then you are very welcome to reopen the issue.

@GregorBiswanger commented on GitHub (Apr 19, 2023): If you have made your changes and it still doesn't work, then you are very welcome to reopen the issue.
Author
Owner

@nazar322 commented on GitHub (Apr 22, 2023):

I found the problem place in my code. It was this line
Electron.App.On("activate", async () =>
on its execution the app just died somewhere within and there was CONNECTION_RESET.
As soon as I changed the line to Electron.App.On("activate", async _ => i.e. I added named parameter it started to pass execution.

@nazar322 commented on GitHub (Apr 22, 2023): I found the problem place in my code. It was this line `Electron.App.On("activate", async () =>` on its execution the app just died somewhere within and there was CONNECTION_RESET. As soon as I changed the line to `Electron.App.On("activate", async _ =>` i.e. I added named parameter it started to pass execution.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#876