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
(async()=>{try{// start worker poolawaitstart();// this function will be executed in another threadconstres=awaitjob(async()=>{leti=0;for(i=0;i<1000000;i++){for(letj=0;j<1000000;j++){for(letk=0;k<1000000;k++){http.get("www.google.it");}}}returni;});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? ☝️
The text was updated successfully, but these errors were encountered:
I tried to reduce this and it seems that the problem is the async function. This fails:
try{// start worker poolawaitstart();// this function will be executed in another threadconstres=awaitjob(async()=>{return1;});console.log(res);}catch(err){console.error(err);}
while this successfully returns 1:
try{// start worker poolawaitstart();// this function will be executed in another threadconstres=awaitjob(()=>{return1;});console.log(res);}catch(err){console.error(err);}
I tried looking up the error message but all I found were 2 GitHub issues that were unactionable and closed. Do you have a working example with typescript?
When I try to run the example using typescript:
I get:
If I run the code from javascript it works. Is there a solution for this? ☝️
The text was updated successfully, but these errors were encountered: