-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
When I try to run the example using typescript:
(async () => {
try {
// start worker pool
await start();
// this function will be executed in another thread
const res = await job(async () => {
let i = 0;
for (i = 0; i < 1000000; i++) {
for (let j = 0; j < 1000000; j++) {
for (let k = 0; k < 1000000; k++) {
http.get("www.google.it");
}
}
}
return i;
});
console.log(res); // 1000000
} catch (err) {
console.error(err);
}
})();
I get:
ReferenceError: tslib_1 is not defined
at eval (eval at <anonymous> ([worker eval]:11:5), <anonymous>:8:37)
at __executor__ (eval at <anonymous> ([worker eval]:11:5), <anonymous>:10:12)
at MessagePort.<anonymous> ([worker eval]:13:27)
at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:399:24)
at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26)
at MessagePort.callbackTrampoline (internal/async_hooks.js:130:17)
If I run the code from javascript it works. Is there a solution for this? ☝️
zcapper, shiro and NickGeek
Metadata
Metadata
Assignees
Labels
No labels