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

TypeError: Invalid value used as weak map key #7

Open
HananoshikaYomaru opened this issue Oct 24, 2024 · 1 comment
Open

TypeError: Invalid value used as weak map key #7

HananoshikaYomaru opened this issue Oct 24, 2024 · 1 comment

Comments

@HananoshikaYomaru
Copy link

HananoshikaYomaru commented Oct 24, 2024

import { threaded } from "multithreading";

const test = 3;

const add = threaded(async function* (a, b) {
  yield test;
  console.log(test);
  return a + b;
});

console.log(await add(5, 10)); // 15

error

/node_modules/.pnpm/[email protected]/node_modules/multithreading/dist/index.mjs:810
      valueOwnershipQueue.set(context[key], []);
                          ^
TypeError: Invalid value used as weak map key
@HananoshikaYomaru
Copy link
Author

seems like only object will work

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

No branches or pull requests

1 participant