You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/Users/fabio/projects/internal/test/test/node_modules/autocannon/lib/manager.js:69
const worker = new Worker(path.resolve(__dirname, './worker.js'), { workerData: { opts: workerOpts } })
^
TypeError: Worker is not a constructor
at init (/Users/fabio/projects/internal/test/test/node_modules/autocannon/lib/manager.js:69:22)
at initWorkers (/Users/fabio/projects/internal/test/test/node_modules/autocannon/lib/manager.js:107:3)
at _init (/Users/fabio/projects/internal/test/test/node_modules/autocannon/lib/init.js:57:5)
at init (/Users/fabio/projects/internal/test/test/node_modules/autocannon/lib/init.js:13:10)
at Object.runWrkPOST (/Users/fabio/projects/internal/test/test/src/bapi.js:61:20)
at Object.<anonymous> (/Users/fabio/projects/internal/test/test/index.js:22:6)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
I also tried to install the autocannon globally and run to check if the problem is in my code, but I'm getting the same error:
fabio@mbp-fabio test % autocannon -c 100 -d 5 -p 10 -w 2 http://localhost:3000/api/v1/status
worker_threads is not available
(node:25183) UnhandledPromiseRejectionWarning: TypeError: Worker is not a constructor
at init (/usr/local/lib/node_modules/autocannon/lib/manager.js:69:22)
at initWorkers (/usr/local/lib/node_modules/autocannon/lib/manager.js:107:3)
at _init (/usr/local/lib/node_modules/autocannon/lib/init.js:57:5)
at Promise (/usr/local/lib/node_modules/autocannon/lib/init.js:24:7)
at new Promise (<anonymous>)
at _init (/usr/local/lib/node_modules/autocannon/lib/init.js:23:21)
at init (/usr/local/lib/node_modules/autocannon/lib/init.js:13:10)
at start (/usr/local/lib/node_modules/autocannon/autocannon.js:232:5)
at Object.<anonymous> (/usr/local/lib/node_modules/autocannon/autocannon.js:259:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
(node:25183) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async functionwithout a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:25183) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Am I forgetting something to use the workers options correctly?
Thanks
I'm running from MAC OS 11.0.1 (Big Sur) and node v10.16.3
The text was updated successfully, but these errors were encountered:
Hi,
I'm using the library with the worker options, using the
onResponse
as file module as said on the documentation:where in
./helpers/on-response.js
:But I'm getting the following error:
I also tried to install the
autocannon
globally and run to check if the problem is in my code, but I'm getting the same error:Am I forgetting something to use the workers options correctly?
Thanks
I'm running from MAC OS 11.0.1 (Big Sur) and node v10.16.3
The text was updated successfully, but these errors were encountered: