You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
worker_threads does not work correctly in ELECTRON_RUN_AS_NODE mode. #17030
Last known working Electron version (if applicable):
N/A
Expected Behavior
>node --experimental-worker app.js
hello from electron as node
hello from main thread
hello from electron as node
hello from worker thread
hello from worker
0
>node -v
v10.11.0
Actual behavior
>electron --experimental-worker app.js
hello from electron as node
hello from main thread
>electron -v
v10.11.0
To Reproduce
[app.js]
console.log("hello from electron as node")const{
Worker,
isMainThread,
parentPort
}=require('worker_threads');if(isMainThread){console.log("hello from main thread")functioncreateWorker(){letworker=newWorker(__filename);worker.on('message',(msg)=>{console.log(msg);});worker.on('error',(err)=>{console.log(err);});worker.on('exit',(code)=>{console.log(code);});}createWorker();}else{console.log("hello from worker thread")parentPort.postMessage("hello from worker");}
Reacted by Sebastiaan Deckers, Matthew Wall, i7soft, Jakub Duras and jkr137
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
changed the title [-]worker_threads does not work correctly.[/-][+]worker_threads does not work correctly under ELECTRON_RUN_AS_NODE[/+]on Feb 18, 2019
changed the title [-]worker_threads does not work correctly under ELECTRON_RUN_AS_NODE[/-][+]worker_threads does not work correctly in ELECTRON_RUN_AS_NODE mode.[/+]on Feb 18, 2019
Activity
welcome commentedon Feb 18, 2019
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
[-]worker_threads does not work correctly.[/-][+]worker_threads does not work correctly under ELECTRON_RUN_AS_NODE[/+][-]worker_threads does not work correctly under ELECTRON_RUN_AS_NODE[/-][+]worker_threads does not work correctly in ELECTRON_RUN_AS_NODE mode.[/+]tfmeneses commentedon Jun 20, 2019
Hi,
I've got the same issue. Have any idea how to fix this?
ermod commentedon Jul 11, 2019
I also have this problem on Linux with:
codebytere commentedon Oct 3, 2019
Closing as duplicate of #18540