Moleculer: Error property 'map' of undefined cpu-usage.js

Created on 22 Sep 2018  路  6Comments  路  Source: moleculerjs/moleculer

Context

  • Moleculer version: moleculer@^0.13.2
  • NodeJS version: v8.9.3
  • Operating System: Ubuntu 16.04

Failure Logs

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)
In Progress Bug

Most helpful comment

Yes. I catch the errors now seperately for each timeout.

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kesslerdev picture kesslerdev  路  4Comments

dylanwulf picture dylanwulf  路  4Comments

icebob picture icebob  路  3Comments

molobala picture molobala  路  3Comments

Kamil93 picture Kamil93  路  3Comments