-
Notifications
You must be signed in to change notification settings - Fork 1
flush is deprecated in OutgoingMessage [iojs] #3
Comments
Sharing the issue here is fine... That doesn't make any sense since In addition, I'm not sure what to suggest here, but I think we will need to do more investigation to see if we need to maybe file a bug against iojs to clear up the confusion. Thank you for reporting the problem! |
I totally agree that flushHeaders would serve a different purpose, I will try to describe what I am seeing so far. You can see the methods in OutgoingMessage here. flushHeaders() flush() flush() still exists which is why it gets called of course but it logs the deprecated message every time now. This behaviour seems very different that what nodejs is doing as can be seen here, both methods exist and are very different. Discussion about the deprecation change is here: |
Thanks for sharing all of the details. In your use case are you opening an HTTP request to another service and rendering HTML to the request body? I want to make sure I understand the problem completely to reproduce the issue. For Node.js I see It looks like Node.js used to have
Source: nodejs/node-v0.x-archive#9048 It looks like the io.js folks took the potentially meaningful Uggh... Ideally, This small difference between io.js and Node.js is causing a problem for us. You could do the following to make io.js more like Node.js, but it is a hack: delete require('http').OutgoingMessage.prototype.flush; Thoughts? |
My use case is very similar to this sample: I am rendering a marko template directly to the express response object. Here is a bit of the stack showing how I end up with this message from the marko side. _http_outgoing.js:651 |
Was there ever a resolution to this? I am seeing the same behavior. |
Hey @Bluejay47 and @jarrodconnolly, I went ahead and filed an issue against the Node.js project: nodejs/node#2920 I see a few options:
Any other ideas? Thoughts? |
I just verified that the problematic delete require('http').OutgoingMessage.prototype.flush; |
Yes, @Bluejay47. That console warning is the same issue. The following fix might feel wrong but it works // Put the following line in your main script:
delete require('http').OutgoingMessage.prototype.flush; io.js introduced the issue and it never existed in Node.js until the two merged with Node.js 4.0.0. If you look at the history you will see that someone used the bad judgement of introducing a |
Thanks for the help. |
Thank you for following up and fixing this long standing and bizarre issue. |
Not sure if this should go here or in marko, trying here first.
The way this module is used by marko Template.render() ends up calling BufferedWriter.flush which is wrapping _http_outgoing.js OutgoingMessage. iojs at least (not sure if nodejs yet) has deprecated the flush message in favour of the flushHeaders method.
This is causing a console log message on every call to render() with the following message:
(node) OutgoingMessage.flush is deprecated. Use flushHeaders instead.
iojs: v2.5.0
marko: 2.7.9
The text was updated successfully, but these errors were encountered: