Electron.NET
Electron.NET copied to clipboard
Uncaught Exception: A Javascript error occurred in the main process in (version 11.5.1)
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:
- Packaged the application using the ElectronNET.CLI (ElectronNET.CLI Version: 9.31.2.0)
- Installed the application in Win 7 OS PC (Remote dekstop)
- Application is running successfully after installation.
- Close remote session by leave the application running for some time like 1 day.
- 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.
- Unhandled Exception: A Javascript error occurred in the main process. After this application goes to non-responsive mode.
- Attached the screenshot for reference.

Please let me know if there is any fix or workaround for the issue. Any help?
Thanks, Ram.
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)
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
Issue still happening. I'm totally unable to run my app.
I switched to Chromely and I am happy.
Please manually remove the host folder from the Obj directory. Then the problem should be fixed.
And please use the latest version of Electron.NET + Electron.NET CLI! (Version 13.5.1)

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.
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
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 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.
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.
🎉🚀 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 I still got that problem on Electron.CLI 23.6.1 with .NET 6 and i got no clue why