useWorker icon indicating copy to clipboard operation
useWorker copied to clipboard

Uncaught ReferenceError: _toConsumableArray2 is not defined/

Open buitrbao222 opened this issue 5 years ago • 2 comments

[Required] Describe the bug Bug happens when using spread syntax in the function passed to useWorker.

[Optional] To Reproduce Steps to reproduce the behavior:

  1. Write a function that uses spread syntax
  2. Pass that function to useWorker to create a worker
  3. Run worker
  4. See error

[Required] Expected behavior The worker to run normally without errors.

[Optional] Screenshots If applicable, add screenshots to help explain your problem.

[Optional] Device (please complete the following information):

  • OS: Windows
  • Browser chrome
  • Version 84.0.4147.125 (Official Build) (64-bit)

[Optional] context Here's the Codesandbox: https://codesandbox.io/s/testing-useworker-9rw9j

buitrbao222 avatar Aug 18 '20 08:08 buitrbao222

check if the solution mentioned in #87 fixes your issue

AhmadMayo avatar Sep 27 '20 09:09 AhmadMayo

Mentioned here: https://github.com/alewin/useWorker/issues/87#issuecomment-699662483

You can try to write code in a way that, on transpiling should not make your function impure.

ashish-r avatar May 21 '22 07:05 ashish-r