Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

'msecs must be a number' after upgrading to Node 0.12.6 #5

Closed
blarsy opened this issue Jul 6, 2015 · 1 comment
Closed

'msecs must be a number' after upgrading to Node 0.12.6 #5

blarsy opened this issue Jul 6, 2015 · 1 comment

Comments

@blarsy
Copy link

blarsy commented Jul 6, 2015

I upgraded to Node 0.12.6, and begun getting the following error on the first request to Kloudless web api:

throw new TypeError('msecs must be a number');
      ^

TypeError: msecs must be a number
at Object.exports.enroll (timers.js:165:11)
at TLSSocket.Socket.setTimeout (net.js:337:12)
at ClientRequest. (_http_client.js:565:10)
at ClientRequest.g (events.js:199:16)
at ClientRequest.emit (events.js:129:20)
at tickOnSocket (_http_client.js:493:7)
at _http_client.js:504:7
at process._tickDomainCallback (node.js:381:11)

After investigation, it seems there was a default value on the msec parameter of the setTimeout function on the previous version of node (0.10), which has disappeared.

I fixed this temporarily on line 21 of kloudless.js (added the timeout property):

this._api = {
    auth: null,
    protocol: Kloudless.defaultConfig.protocol,
    host: Kloudless.defaultConfig.host,
    port: Kloudless.defaultConfig.port,
    ca: null,
    basePath: Kloudless.defaultConfig.basePath,
    timeout: 2000
};

Could we get a better fix ?

@vinodc
Copy link
Member

vinodc commented Jul 6, 2015

Thanks @blarsy. I've set it to the previous default value that used to exist (2 min) in 71d008b. Let me know if any other issues come up.

@vinodc vinodc closed this as completed Jul 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants