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

function could not be cloned #64

Open
mikejernil opened this issue Jun 4, 2020 · 1 comment
Open

function could not be cloned #64

mikejernil opened this issue Jun 4, 2020 · 1 comment

Comments

@mikejernil
Copy link

mikejernil commented Jun 4, 2020

I'm using a function inside my job since it is from a library i use for compression and it is the CPU intensive task i need to allocate to the worker thread. this is returning an Error for me
saying ' The function{ } cannot be cloned '.
What does this mean & how do i solve this?

If this is not the proper place to ask this and you'd prefer i ask this on stack overflow, i'll bring this down.

@dgellow
Copy link

dgellow commented Apr 20, 2024

Unfortunately that's a limitation of the cloning algorithm used when passing data to worker threads. See https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm. That's not something that can be solved without changes to javascript engines.

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

2 participants