Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting navigator.hardwareConcurrency throws on workers #12353

Closed
andreubotella opened this issue Oct 7, 2021 · 0 comments · Fixed by #12354
Closed

Getting navigator.hardwareConcurrency throws on workers #12353

andreubotella opened this issue Oct 7, 2021 · 0 comments · Fixed by #12354

Comments

@andreubotella
Copy link
Contributor

// main.js
new Worker(new URL("./worker.js", import.meta.url).href, {type: "module"});
// worker.js
console.log(navigator.hardwareConcurrency);
error: Uncaught (in worker "") TypeError: Illegal invocation
console.log(navigator.hardwareConcurrency);
                      ^
    at Object.assertBranded (deno:ext/webidl/00_webidl.js:923:13)
    at WorkerNavigator.get [as hardwareConcurrency] (deno:runtime/js/99_main.js:351:16)
    at file:///home/abotella/worker-test/hardwareConcurrency/worker.js:1:23
error: Uncaught (in promise) Error: Unhandled error event in child worker.
    at Worker.#pollControl (deno:runtime/js/11_workers.js:267:21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant