First i use async and await very often and i get this error:
RangeError: Value undefined out of range for undefined options property undefined
at Set.add (<anonymous>)
at AsyncHook.init (internal/inspector_async_hook.js:19:25)
at PromiseWrap.emitInitNative (internal/async_hooks.js:134:43)
And i dont know how i can fix this, i write my code completly in Typescript and i dont created any file that is named 'async_hooks'.
And i dont run more then 10 function async at once i use await very often so it shouldnt stack up but javascript seems not to reduce the asyncId and reach the number limit very fast.
I tried to use less async await but this didnt fix the problem, but the error msg comes later. If i use very less async await i can prevent that this error comes until the function successfully finish the job. (I use Electron 7)
Electron seems to have a very low async pool but it can be reproduced by a default typescript code:
class Test {
private async testCompare(a,b):Promise<boolean> {
return a == b;
}
public async testRun():Promise<void> {
for (let index = 0; index < 999999999; index++) {
for (let index2 = 0; index2 < 999999999; index2++) {
await this.testCompare(index,index2)
}
}
}
}
new Test().testRun();
This Code produce very much ram usage, and i think i have the same problem in my program. I think that the async pool get filled up until it reached its limit.