xanderfrangos / twinkle-tray

Easily manage the brightness of your monitors in Windows from the system tray
https://twinkletray.com
MIT License
5.46k stars 180 forks source link

a javascript error occurred in the main process #246

Open yangchris4 opened 3 years ago

yangchris4 commented 3 years ago

a javascript error occurred in the main process

Uncaught Exception: Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed at ChildProcess.target.send (internal/child_process.js:705:16) at C:\Users\Administrator\AppData\Local\Programs\twinkle-tray\resources\app.asar\src\electron.js:1032:20 at new Promise () at refreshMonitorsJob (C:\Users\Administrator\AppData\Local\Programs\twinkle-tray\resources\app.asar\src\electron.js:1031:16) at refreshMonitors (C:\Users\Administrator\AppData\Local\Programs\twinkle-tray\resources\app.asar\src\electron.js:1091:25) at IpcMainImpl. (C:\Users\Administrator\AppData\Local\Programs\twinkle-tray\resources\app.asar\src\electron.js:1374:3) at IpcMainImpl.emit (events.js:315:20) at Object. (electron/js2c/browser_init.js:161:9692) at Object.emit (events.js:315:20)

Snipaste_2021-09-26_09-28-08

menghu1994 commented 3 years ago

The same fault,and the solution from the Internet can not work.

tech189 commented 3 years ago

This popup keeps appearing, even if I restart the app, same problem. I am on Windows 11.

[Window Title]
Error

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
    at ChildProcess.target.send (internal/child_process.js:705:16)
    at C:\Users\$USER\AppData\Local\Programs\twinkle-tray\resources\app.asar\src\electron.js:1032:20
    at new Promise (<anonymous>)
    at refreshMonitorsJob (C:\Users\$USER\AppData\Local\Programs\twinkle-tray\resources\app.asar\src\electron.js:1031:16)
    at refreshMonitors (C:\Users\$USER\AppData\Local\Programs\twinkle-tray\resources\app.asar\src\electron.js:1091:25)
    at Timeout._onTimeout (C:\Users\$USER\AppData\Local\Programs\twinkle-tray\resources\app.asar\src\electron.js:2382:7)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

[OK]
zur4ik commented 3 years ago

Same problem on Windows 11 Started getting this error after updating to 22483.1000

Peter-Maguire commented 2 years ago

Same issue here. Windows 11 22499.1000

LPFchan commented 2 years ago

Yep, same issue here as well. I'm currently on 22494.1000

CeoOfFry commented 2 years ago

same, 22499.1000

Abysmax commented 2 years ago

Same

xanderfrangos commented 2 years ago

It seems to primarily be a Windows 11 Insider issue, though some Windows 10 users are having it as well. I'll be looking into the issue this weekend. For now, I'm going to pin this Issue and point similar ones here. I may post an test version to this Issue for people to try if they'd like to help.

xanderfrangos commented 2 years ago

Good news, I've found the source of the problem on Windows 11 Insider builds: https://winaero.com/microsoft-removed-the-wmic-tool-from-windows-11-dev-builds/

Bad news, I don't currently have an alternative. I might need to find a new way to access WMI via Node...

xanderfrangos commented 2 years ago

I don't yet have a fix for WMIC being unavailable in newer Windows 11 Insider builds, but I have improved error handling relating to the error message. The following build of Twinkle Tray should work fine for DDC/CI displays on any version of Windows 11:

https://1drv.ms/u/s!AiWKFpjcSKRQhskFgapyA5bewKf4IQ?e=4qYD3G

Your laptop's internal display will NOT be listed in Twinkle Tray on this build if you are in the Windows 11 Insider program. However, if you guys can let me know if external monitors are working (and the UI in general) in the above version of Twinkle Tray, it would be greatly appreciated.

Peter-Maguire commented 2 years ago

Can confirm on Windows 11 22499 with that version all of my external displays are listed. Thanks!

anhtuan23 commented 2 years ago

It's working as stated on my Windows 11 22499 too.

TheSiZaGaming commented 2 years ago

On the latest version of the Windows Insider Preview for Windows 11, I receive the same error whenever I try to access the tray icon, or use the interface in any way. The build number is 22504.1000 and I think this might be the case thanks to Microsoft's removal of WMIC as listed above. Your idea for this project is amazing, and I do hope you find a workaround soon.

yan1019 commented 2 years ago

I don't yet have a fix for WMIC being unavailable in newer Windows 11 Insider builds, but I have improved error handling relating to the error message. The following build of Twinkle Tray should work fine for DDC/CI displays on any version of Windows 11:

https://1drv.ms/u/s!AiWKFpjcSKRQhskFgapyA5bewKf4IQ?e=4qYD3G

Your laptop's internal display will NOT be listed in Twinkle Tray on this build if you are in the Windows 11 Insider program. However, if you guys can let me know if external monitors are working (and the UI in general) in the above version of Twinkle Tray, it would be greatly appreciated.

This version runs normally on my Windows 11 Insider Preview 22499.1010 system, all functions are normal

xanderfrangos commented 2 years ago

Great, thanks for confirming! I have one more test version for you all before I release an update. It'll probably be a little while before I can address the lack of WMIC, but I can at least get rid of the errors for now.

Anyway, let me know if this one is still OK on 22499+: https://1drv.ms/u/s!AiWKFpjcSKRQhskH-JyFYD1pq-8jbg?e=lj3mmJ

dejwi commented 2 years ago

Great, thanks for confirming! I have one more test version for you all before I release an update. It'll probably be a little while before I can address the lack of WMIC, but I can at least get rid of the errors for now.

Anyway, let me know if this one is still OK on 22499+: https://1drv.ms/u/s!AiWKFpjcSKRQhskH-JyFYD1pq-8jbg?e=lj3mmJ

Windows 11 Insider Preview 10.0.22499.1010 works good

RgazHTale commented 2 years ago

Same error occur on my win10. I solved the error by reinstall win10. Now my computer is win11. Everything is ok.

xanderfrangos commented 2 years ago

Hi all,

I've released v1.13.11 with a full replacement for WMIC. This means the Twinkle Tray should work correctly on all builds of Windows 11 now. Let me know if you guys run into any issues.

I'm holding off on a Windows Store update for a day or two to see if anyone reports new bugs related to the WMIC replacement. So if you want to test and are using the Windows Store version, so you should uninstall that and use the EXE from GitHub.

Rakambda commented 2 years ago

Any update on publishing it on Windows Store?

xanderfrangos commented 2 years ago

Any update on publishing it on Windows Store?

Some users are having issues with the new C++ bindings, so I'm holding off on Windows Store updates until I can get this resolved. (https://github.com/xanderfrangos/twinkle-tray/issues/286)

gferreroferri commented 2 years ago

I also get this error. Not sure if this is the same Screenshot 2022-09-15 085724

kwanghuee commented 1 year ago

Windows 7 image

xanderfrangos commented 1 year ago

@kwanghuee Only Windows 10 and 11 are supported operating systems.