TypeError: Cannot read property 'map' of undefined
at Timeout.setTimeout [as _onTimeout] (/home/devuser/project/node_modules/moleculer/src/cpu-usage.js:23:28)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
Somebody can reproduce it?
Sometimes os.cpus() returns undefined.
https://github.com/nodejs/node/issues/19022
Thx the info.
Error is not fixed.
Context:
Moleculer version: moleculer@^0.13.3
Try this example:
try {
setTimeout(function () {
a.map(function () {})
}, 5000)
} catch(e) {
console.log(111);
}
@faeron it's true. The outer try...catch can't catch the setTimeout callback errors. Could you fix it?
Yes. I catch the errors now seperately for each timeout.
Most helpful comment
Yes. I catch the errors now seperately for each timeout.