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: Timeout must be a number! #125

Closed
viglucci opened this issue Sep 29, 2016 · 4 comments · May be fixed by #126
Closed

Error: Timeout must be a number! #125

viglucci opened this issue Sep 29, 2016 · 4 comments · May be fixed by #126

Comments

@viglucci
Copy link

Updating to version 2.2.0 from ^2.0.2 causes the below error to be emitted constantly when watching with gulp-watch. Reverting to [email protected] seems to be working as expected.

I see that gulp-watch also published 4.3.10 (which we are running) the same day as [email protected], is this related?

Message:
    Timeout must be a number!
Stack:
Error: Timeout must be a number!
    at Function.script.emit (c:\dev\project-name\node_modules\gulp-nodemon\index.js:94:13)
    at reloadServer (c:\dev\project-name\gulp\tasks\development.js:58:10)
    at wrappedMapper (c:\dev\project-name\node_modules\event-stream\node_modules\map-stream\index.js:84:19)
    at Stream.stream.write (c:\dev\project-name\node_modules\event-stream\node_modules\map-stream\index.js:96:21)
    at Duplex.ondata (c:\dev\project-name\node_modules\gulp-watch\node_modules\readable-stream\lib\_stream_readable.js:542:20)
    at emitOne (events.js:77:13)
    at Duplex.emit (events.js:169:7)
    at readableAddChunk (c:\dev\project-name\node_modules\gulp-watch\node_modules\readable-stream\lib\_stream_readable.js:213:18)
    at Duplex.Readable.push (c:\dev\project-name\node_modules\gulp-watch\node_modules\readable-stream\lib\_stream_readable.js:172:10)
    at Duplex._write (c:\dev\project-name\node_modules\gulp-watch\index.js:66:8)
@ColemanGariety
Copy link
Owner

ColemanGariety commented Sep 29, 2016

@viglucci would you mind posting the relevant lines from your Gulpfile?

Definitely related to the new emit logic.

Would you mind upgrading to 2.2.1 and trying again?

@ColemanGariety
Copy link
Owner

@IOAyman I think that the emit shim traded backward-compatibility with node's EventEmitter class (the timeoutInSecs). I'm going to revert it until we come up with a solution that won't break existing code.

I have a feeling that viglucci's code looks like this:

stream.emit('event a', 'event b', 'event c')

@IOAyman
Copy link
Contributor

IOAyman commented Sep 29, 2016

@JacksonGariety Noted. I'll push a quick fix in a PR

@viglucci
Copy link
Author

viglucci commented Sep 29, 2016

@JacksonGariety bumping to [email protected] seems to be working as expected.

Unfortunately I am not at liberty to share source, however we are using the run-sequence module to run a combination of tasks in series and in parallel that are separated into different module files. One such task starts nodemon and exports a function which calls require("event-stream").map(callback) where callback calls server.emit("restart", file) (where server is a instance of nodemon). The exported function is then included in a gulp stream which is watching source and streams files on change using gulp-watch.

Since we are not using the nodemon tasks feature, it looks like for our needs we can drop the second argument from server.emit("restart"), and if needed will pass 0 as the second argument for sanity.

Thanks for addressing this.

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

Successfully merging a pull request may close this issue.

3 participants