question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cant use worker threads

See original GitHub issue

Trying to run the following code using NW.js v0.43.0 returns “Error: The V8 platform used by this instance of Node does not support creating Workers”

const { Worker } = require('worker_threads');

const worker = new Worker('const { parentPort } = require("worker_threads");parentPort.once("message",message => parentPort.postMessage({ pong: message }));  ', { eval: true });
worker.on('message', message => console.log(message));      
worker.postMessage('ping');  

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rogerwangcommented, Dec 23, 2019

The fix is released in 0.44.0 beta1

0reactions
rogerwangcommented, Mar 10, 2020

Please check and post updates in #7114. This issue is the duplicate of it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Compilation error on worker thread in Typescript
worker.workerData is an arbitrary JavaScript value that contains a clone of the data passed to this thread's Worker constructor so it needs ...
Read more >
Unable to use NodeJS worker_threads module #18540 - GitHub
A workaround may be passing signal to trigger things in main thread and return data back to the worker thread. You may use...
Read more >
Using worker_threads in Node.js - Medium
This is a beginner's guide to using worker_threads in Node.js. It does not assume you already understand Web Workers. (The API for worker_threads...
Read more >
A Brief Guide on Worker Threads in Node.js
How you can use worker threads in Node.js.
Read more >
How to work with worker threads in NodeJS
Why Can't Node Handle CPU Intensive Tasks? We call the single thread running in Node programs the event loop. Node uses it to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found