-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.
Description
- Version: v11.8.0
- Platform: Darwin NY-GTaverasMBA 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
- Subsystem: worker_threads
The following code produces this error:
ERROR:
import { workerData } from 'worker_threads';
^^^^^^^^^^
SyntaxError: The requested module 'worker_threads' does not provide an export named 'workerData'
main.mjs
:
import { Worker } from 'worker_threads';
const worker = new Worker('./worker.js', { workerData: 'Hello from main thread' });
worker.mjs
:
import { workerData } from 'worker_threads';
console.log(workerData);
COMMAND:
node --experimental-modules main.mjs
addaleax
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.