Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error property 'map' of undefined cpu-usage.js #379

Closed
yohanyars opened this issue Sep 22, 2018 · 6 comments · Fixed by #390
Closed

Error property 'map' of undefined cpu-usage.js #379

yohanyars opened this issue Sep 22, 2018 · 6 comments · Fixed by #390

Comments

@yohanyars
Copy link

yohanyars commented Sep 22, 2018

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)
@icebob
Copy link
Member

icebob commented Sep 23, 2018

Somebody can reproduce it?

@icebob icebob added the Status: Need reproduce Issue waits for reproducing label Sep 23, 2018
@yohanyars
Copy link
Author

Sometimes os.cpus() returns undefined.
nodejs/node#19022

@icebob icebob added Type: Bug and removed Status: Need reproduce Issue waits for reproducing labels Sep 26, 2018
@icebob
Copy link
Member

icebob commented Sep 26, 2018

Thx the info.

@icebob icebob closed this as completed in dc873b3 Sep 27, 2018
icebob added a commit that referenced this issue Sep 27, 2018
reject promise if no cpu data is returned fix #379
@yohanyars
Copy link
Author

yohanyars commented Oct 3, 2018

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); 
}

@icebob
Copy link
Member

icebob commented Oct 3, 2018

@faeron it's true. The outer try...catch can't catch the setTimeout callback errors. Could you fix it?

@faeron
Copy link
Contributor

faeron commented Oct 4, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants