I am writing an Electron app and whenever I used console.log()
or any of its variants in the main process, the app will crash and it will open a popup with the following message:
Error X
A JavaScript error occurred in the main process
Uncaught Exception:
Error: open EISDIR
at new Socket (node:net:413:13)
at createWritableStdioStream (node:internal/bootstrap/switches/is_main_thread:78:18)
at process.getStderr [as stderr] (node:internal/bootstrap/switches/is_main_thread:170:12)
at console.get (node:internal/console/constructor:220:44)
at console.value (node:internal/console/constructor:347:50)
at console.warn (node:internal/console/constructor:382:61)
at loadApplicationPackage (D:\Code\Node\CraftPanel\app\node_modules\electron\dist\resources\default_app.asa...:17)
at Object.<anonymous> (D:\Code\Node\CraftPanel\app\node_modules\electron\dist\resources\default_app.asar\...:9)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1296:10)
Has anyone else encountered this? I haven't used Electron in a while but in previous projects I had no issue logging messages using console.log()
before.
I'm writing the app in Typescript, running it on Windows through WSL2, and I'm running it through concurrently
so I can launch my React frontend and Electron app in parallel.