fix: enable worker threads in ELECTRON_RUN_AS_NODE#20416
Conversation
4bdb755 to
19fc67b
Compare
19fc67b to
b784d0a
Compare
8161daf to
ed486ed
Compare
ed486ed to
8649c8c
Compare
8649c8c to
77198f8
Compare
|
Hi, is it working now ? I'm Using electron 6.0.11 , but still got error The V8 platform used by this instance of Node does not support creating Workers |
|
Release Notes Persisted
|
|
I was unable to backport this PR to "7-0-x" cleanly; |
|
@codebytere has manually backported this PR to "7-0-x", please check out #20456 |
|
@codebytere has manually backported this PR to "6-0-x", please check out #20457 |
|
Hello, it still isn't work ? |
|
@Inomezi what released version did you test with? |
I tested it on version 6.0.12 and 7.0.0-beta.6. When i calling |
|
@Inomezi that's a different issue; i'm still working on that! It's not fixed yet. |
Okay, i'll wait. There is no version on which I could create worker_threads now? |
@codebytere Was that something we discussed in the last weeks? Is that anything that I could help with? |
Description of Change
Fix Node.js'
worker_threadsmodule when Electron is run withELECTRON_RUN_AS_NODE. The fundamental issue here is that Electron setsNODE_USE_V8_PLATFORMtofalse, because Electron initializes the v8 platform itself (injavascript_environment.cc), and Node.js worker thread initialization relies on theplatformit uses having been set inside code guarded byNODE_USE_V8_PLATFORM.This commit fixes this problem by changing
node_worker.ccto use the three-argimplementation of
NewIsolateto prevent it trying to use a possibly-null ptr.cc @ckerr @nornagon @zcbenz
Checklist
npm testpassesRelease Notes
Notes: Fixed Node.js'
worker_threadsinELECTRON_RUN_AS_NODE.