You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Causes uncaught TypeError: object is not a function #42
I'm trying to use this in combination with the AWS SDK. After some number of requests, this uncaught error is thrown:
Uncaught TypeError: object is not a function
at afterWrite (_stream_writable.js:354:3)
at onwrite (_stream_writable.js:345:7)
at WritableState.onwrite (_stream_writable.js:89:5)
at Socket._writeGeneric (net.js:706:5)
at Socket._writev (net.js:711:8)
at doWrite (_stream_writable.js:298:12)
at clearBuffer (_stream_writable.js:387:5)
at Socket.Writable.uncork (_stream_writable.js:237:7)
at ClientRequest._flushOutput (_http_outgoing.js:673:10)
at ClientRequest.OutgoingMessage._flush (_http_outgoing.js:647:16)
at _http_client.js:156:10
at callSocketMethod (_http_client.js:552:7)
at ClientRequest.onSocket (_http_client.js:557:7)
at tickOnSocket (_http_client.js:523:7)
at onSocketNT (_http_client.js:535:5)
Using the default Node agent does not cause this behavior. This is on Node 4.5.0.
I should note that I run into this behavior when using new http.Agent({ keepAlive: true }) as well, but not when using new http.Agent(). So perhaps this is an issue internal to Node itself. :(
I'm getting a similar error, both version 2.2.0 and 3.1.1 when trying to use it with webpack-dev-server.
_stream_writable.js:388
cb();
^
TypeError: object is not a function
at afterWrite (_stream_writable.js:388:3)
at onwrite (_stream_writable.js:379:7)
at WritableState.onwrite (_stream_writable.js:90:5)
at Socket._writeGeneric (net.js:721:5)
at Socket._write (net.js:731:8)
at doWrite (_stream_writable.js:334:12)
at writeOrBuffer (_stream_writable.js:320:5)
at Socket.Writable.write (_stream_writable.js:247:11)
at Socket.write (net.js:658:40)
at ClientRequest.OutgoingMessage._writeRaw (_http_outgoing.js:170:23)
The error doesn't occur when not using agentkeepalive, but obviously, the connections aren't kept alive, so my Windows Authentication won't work.
response headers [2]
expecting the last response, but instead it fails.
_stream_writable.js:361
cb();
^
TypeError: cb is not a function
at afterWrite (_stream_writable.js:361:3)
at onwrite (_stream_writable.js:352:7)
at WritableState.onwrite (_stream_writable.js:89:5)
at Socket._writeGeneric (net.js:714:5)
at Socket._write (net.js:724:8)
at doWrite (_stream_writable.js:307:12)
at writeOrBuffer (_stream_writable.js:293:5)
at Socket.Writable.write (_stream_writable.js:220:11)
at Socket.write (net.js:650:40)
at ClientRequest.OutgoingMessage._writeRaw (_http_outgoing.js:167:23)
Activity
cdhowie commentedon Sep 15, 2016
I should note that I run into this behavior when using
new http.Agent({ keepAlive: true })as well, but not when usingnew http.Agent(). So perhaps this is an issue internal to Node itself. :(fengmk2 commentedon Dec 17, 2016
Can you show me a demo to reappear this problem?
cdhowie commentedon Dec 21, 2016
I will try to produce a self-contained repro.
ngbrown commentedon Feb 20, 2017
I'm getting a similar error, both version 2.2.0 and 3.1.1 when trying to use it with
webpack-dev-server.The error doesn't occur when not using
agentkeepalive, but obviously, the connections aren't kept alive, so my Windows Authentication won't work.ngbrown commentedon Feb 20, 2017
This may actually be a Node.js issue, as the default
http.Agentalso fails whenkeepAiveis true.nodejs/node#8650
chimurai commentedon Mar 1, 2017
Same issue in this thread: chimurai/http-proxy-middleware#39 (comment)
Hopefully you guys can help to solve it.
Reproducible with a tiny example (created by @EladBezalel)
c3215-untitled.gz - source: chimurai/http-proxy-middleware#39 (comment)
https://localhost:12345/api/123- works: browser -> serverhttps://localhost:3000/api/123- fails: browser -> proxy + keepalive -> serverHere is some debug logging from the example:
$ NODE_DEBUG=http,net node index.jschimurai commentedon Mar 1, 2017
https://blogs.msdn.microsoft.com/chiranth/2013/09/20/ntlm-want-to-know-how-it-works/
Looks like it fails somewhere between 2nd request and 2nd response.
request headers [1]
response headers [1]
request headers [2]
response headers [2]
expecting the last response, but instead it fails.
fengmk2 commentedon Mar 2, 2017
@chimurai Which node version?
chimurai commentedon Mar 2, 2017
tested with v6.2.1 and v7.71
chimurai commentedon Mar 3, 2017
Found the issue in
http-proxy-middleware. (chimurai/http-proxy-middleware#149)@ngbrown This might fix the issue you're having, since webpack-dev-server is using http-proxy-middleware to do the proxying.
cdhowie commentedon Mar 3, 2017
There is still an issue in Node proper, however, as I encounter this error using Node's own http.Agent in keepalive mode.