-
Notifications
You must be signed in to change notification settings - Fork 101
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
useWorker error when destructuring function arguments #97
Comments
Hi @juansalvatore! Thanks for reporting This seems to be an issue with browser compatibility and transpiling. What is probably happening is that your build (and CodeSandbox's) is targeted to browsers previous to array destructuring so it gets transpiled and that invokes some functions which are not available on worker side. (The reference error mentioning babel you're seeing in the error message) The second bug you're mentioning seems to be related to functions not being available on the worker side. We're now working on support for those! 😄 (details in #98) |
Let me see if I can make a repro locally and make changes from our side to make it work, or at least add some warnings |
@zant |
This is due to webpack transpiling your code. When you use |
[Required] Describe the bug
When passing a function to useWorker that has argument destructuring I get the error shown on the screenshot.
[Optional] To Reproduce
Steps to reproduce the behavior:
[Required] Expected behavior
Destructuring function arguments break the worker.
[Optional] Screenshots
This is the error I get in my project:
The text was updated successfully, but these errors were encountered: