Uncaught Exception: A Javascript error occurred in the main process in (version 11.5.1) #627

Closed
opened 2026-01-29 16:44:36 +00:00 by claunia · 14 comments
Owner

Originally created by @rambabu-paluru-tfs on GitHub (Feb 6, 2021).

Originally assigned to: @GregorBiswanger on GitHub.

Hi,

ElectronNET.API version - 11.5.1.0
.NET 5
NodeJS version - v12.16.3
Blazor Serverside project is running using the ElectronNET framework.

Steps to Reproduce:

  1. Packaged the application using the ElectronNET.CLI (ElectronNET.CLI Version: 9.31.2.0)
  2. Installed the application in Win 7 OS PC (Remote dekstop)
  3. Application is running successfully after installation.
  4. Close remote session by leave the application running for some time like 1 day.
  5. Connect to the remote desktop and perform an action in the application which gets the GetContentSizeAsync() to get the size of the content from the BrowserWindow instance.
  6. Unhandled Exception: A Javascript error occurred in the main process. After this application goes to non-responsive mode.
  7. Attached the screenshot for reference.
    image

Please let me know if there is any fix or workaround for the issue.
Any help?

Thanks,
Ram.

Originally created by @rambabu-paluru-tfs on GitHub (Feb 6, 2021). Originally assigned to: @GregorBiswanger on GitHub. Hi, ElectronNET.API version - 11.5.1.0 .NET 5 NodeJS version - v12.16.3 Blazor Serverside project is running using the ElectronNET framework. Steps to Reproduce: 1. Packaged the application using the ElectronNET.CLI (ElectronNET.CLI Version: 9.31.2.0) 2. Installed the application in Win 7 OS PC (Remote dekstop) 3. Application is running successfully after installation. 4. Close remote session by leave the application running for some time like 1 day. 5. Connect to the remote desktop and perform an action in the application which gets the GetContentSizeAsync() to get the size of the content from the BrowserWindow instance. 6. Unhandled Exception: A Javascript error occurred in the main process. After this application goes to non-responsive mode. 7. Attached the screenshot for reference. ![image](https://user-images.githubusercontent.com/65698311/107119920-977cbf80-68b0-11eb-951e-1bb33664879b.png) Please let me know if there is any fix or workaround for the issue. Any help? Thanks, Ram.
claunia added the bug label 2026-01-29 16:44:36 +00:00
Author
Owner

@peerem commented on GitHub (Feb 28, 2021):

We have the same problem with version 11.5.1 and a Blazor Server App (.NET 5).

We would like to continue using Electron.Net in the future because it looks like the new WebWindow in .NET 6 has too many requirements for the user (installed browser).

Uncaught Exception:
Error: spawn
C:...exe
ENOENT
at Process.ChildProcess.handle.onexit (internal/child_process,js:267:19)
at onErrorNT (internal/child_process,js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

@peerem commented on GitHub (Feb 28, 2021): We have the same problem with version 11.5.1 and a Blazor Server App (.NET 5). We would like to continue using Electron.Net in the future because it looks like the new WebWindow in .NET 6 has too many requirements for the user (installed browser). Uncaught Exception: Error: spawn C:\...exe ENOENT at Process.ChildProcess.handle.onexit (internal/child_process,js:267:19) at onErrorNT (internal/child_process,js:469:16) at processTicksAndRejections (internal/process/task_queues.js:84:21)
Author
Owner

@FancyFurret commented on GitHub (Apr 21, 2021):

I have the exact same issue as @peerem, using 11.5.1 and Blazor in .NET 5. I'm on macOS if that changes anything.

Anyone figure out a workaround yet? I would like to get my project started

@FancyFurret commented on GitHub (Apr 21, 2021): I have the exact same issue as @peerem, using 11.5.1 and Blazor in .NET 5. I'm on macOS if that changes anything. Anyone figure out a workaround yet? I would like to get my project started
Author
Owner

@miggat commented on GitHub (Jul 8, 2021):

Issue still happening. I'm totally unable to run my app.

@miggat commented on GitHub (Jul 8, 2021): Issue still happening. I'm totally unable to run my app.
Author
Owner

@peerem commented on GitHub (Jul 8, 2021):

I switched to Chromely and I am happy.

@peerem commented on GitHub (Jul 8, 2021): I switched to Chromely and I am happy.
Author
Owner

@GregorBiswanger commented on GitHub (Jul 8, 2021):

Please manually remove the host folder from the Obj directory. Then the problem should be fixed.

@GregorBiswanger commented on GitHub (Jul 8, 2021): Please manually remove the host folder from the Obj directory. Then the problem should be fixed.
Author
Owner

@GregorBiswanger commented on GitHub (Jul 8, 2021):

And please use the latest version of Electron.NET + Electron.NET CLI! (Version 13.5.1)

@GregorBiswanger commented on GitHub (Jul 8, 2021): And please use the latest version of Electron.NET + Electron.NET CLI! (Version 13.5.1)
Author
Owner

@ReinaldoAssis commented on GitHub (Nov 29, 2021):

image

Hi there, I've been having the same problem as mentioned above. I've deleted the Obj folder as recommended by @GregorBiswanger , but it didn't solve the problem. The strange thing is: when I run the project with electronize start /watch, it works just fine... It only throws this bug when trying to build or using electronize start. I'd really appreciate any help with this issue, best regards.

@ReinaldoAssis commented on GitHub (Nov 29, 2021): ![image](https://user-images.githubusercontent.com/25367779/143794038-76f98d4e-3f96-4fdc-abdc-b7f2ac76f8e3.png) Hi there, I've been having the same problem as mentioned above. I've deleted the Obj folder as recommended by @GregorBiswanger , but it didn't solve the problem. The strange thing is: when I run the project with electronize start /watch, it works just fine... It only throws this bug when trying to build or using electronize start. I'd really appreciate any help with this issue, best regards.
Author
Owner

@AndyMedtronic commented on GitHub (Dec 1, 2021):

I am having exactly the same problem as Reinaldo. Is there any fix to this, or are there ways round it. When it works with the /watch however I get a browser window appearing, and then the app window

@AndyMedtronic commented on GitHub (Dec 1, 2021): I am having exactly the same problem as Reinaldo. Is there any fix to this, or are there ways round it. When it works with the /watch however I get a browser window appearing, and then the app window
Author
Owner

@AndyMedtronic commented on GitHub (Dec 2, 2021):

Had a revelation with this. My electron.manifest.json had empty strings in executable and productName. Populating these caused it to run up succesfully without the /watch

{
"executable": "ElectronServer",
"splashscreen": {
"imageFile": ""
},
"name": "",
"author": "",
"singleInstance": false,
"environment": "Production",z
"build": {
"appId": "com..app",
"productName": "ElectronServer",
.....

@AndyMedtronic commented on GitHub (Dec 2, 2021): Had a revelation with this. My electron.manifest.json had empty strings in executable and productName. Populating these caused it to run up succesfully without the /watch { "executable": "**ElectronServer**", "splashscreen": { "imageFile": "" }, "name": "", "author": "", "singleInstance": false, "environment": "Production",z "build": { "appId": "com..app", "productName": **"ElectronServer",** .....
Author
Owner

@ReinaldoAssis commented on GitHub (Dec 2, 2021):

@AndyMedtronic You are an angel! Thanks a lot for sharing your experience, with your help I was able to figure out what I was doing wrong. I will share it here for anyone having this problem. Basically, I had changed the name of my project from OpenManga to Lexi. So my configuration was looking like this:

"executable": "Lexi",
"splashscreen": {
"imageFile": ""
},
"name": "Lexi",
"author": "Reinaldo Miranda de Assis",
"singleInstance": false,
"environment": "Production",
"build": {
"appId": "com.Lexi.app",
"productName": "Lexi",

As soon as I changed the names back to the original "OpenManga", everything worked fine! You have to be careful when renaming these kinds of things haha.

@ReinaldoAssis commented on GitHub (Dec 2, 2021): @AndyMedtronic You are an angel! Thanks a lot for sharing your experience, with your help I was able to figure out what I was doing wrong. I will share it here for anyone having this problem. Basically, I had changed the name of my project from OpenManga to Lexi. So my configuration was looking like this: "executable": "Lexi", "splashscreen": { "imageFile": "" }, "name": "Lexi", "author": "Reinaldo Miranda de Assis", "singleInstance": false, "environment": "Production", "build": { "appId": "com.Lexi.app", "productName": "Lexi", As soon as I changed the names back to the original "OpenManga", everything worked fine! You have to be careful when renaming these kinds of things haha.
Author
Owner

@teremy commented on GitHub (Aug 3, 2022):

Since this issue is still open. I had renamed my Visual Studio Solution and the electronize build failed afterwards. I rerun electronize init and it recreated the electron.manifest.json with a different executable and name. Then the build worked again.

@teremy commented on GitHub (Aug 3, 2022): Since this issue is still open. I had renamed my Visual Studio Solution and the electronize build failed afterwards. I rerun electronize init and it recreated the electron.manifest.json with a different executable and name. Then the build worked again.
Author
Owner

@GregorBiswanger commented on GitHub (Mar 28, 2023):

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

@GregorBiswanger commented on GitHub (Mar 28, 2023): 🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉 With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!
Author
Owner

@J0J0008 commented on GitHub (Sep 18, 2023):

@GregorBiswanger I still got that problem on Electron.CLI 23.6.1 with .NET 6 and i got no clue why

@J0J0008 commented on GitHub (Sep 18, 2023): @GregorBiswanger I still got that problem on Electron.CLI 23.6.1 with .NET 6 and i got no clue why
Author
Owner

@amigax commented on GitHub (May 16, 2024):

same issue here. such a shame electron doesnt work.

@amigax commented on GitHub (May 16, 2024): same issue here. such a shame electron doesnt work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#627