node-sunny
node-sunny copied to clipboard
google connector doesn't work in node version > 0.8.23
Updated nodejs to version 0.10.5 and get error while trying to work with google cloud storage:
TypeError: Cannot read property 'container' of null
at null.
But the same script works fine in node v.0.8.23 and less
Probably hitting some snags with streams2 in v0.10.x. I'm slammed right now, but I'll see what I can do when I get some free time. My guess is that https://github.com/ryan-roemer/node-sunny/blob/master/lib/stream.js is going to need some rewriting / modifications.
In the meantime, if you or anyone you know is up on new streams and would like to tackle this, I would absolutely love a pull request!
I am also encountering this with aws storage. I can reproduce it just by trying to run the asyc wrapped code example from the guide page.
containerObj = results.container;
^
TypeError: Cannot read property 'container' of null
at null.<anonymous> (/svnwork/openmx/sunnytest.js:29:29)
at EventEmitter.emit (events.js:117:20)
at AuthenticatedRequest.processResults (/svnwork/openmx/node_modules/sunny/lib/request.js:453:10)
at ClientRequest.<anonymous> (/svnwork/openmx/node_modules/sunny/lib/request.js:389:16)
at ClientRequest.EventEmitter.emit (events.js:117:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1689:21)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:120:23)
at Socket.socketOnData [as ondata] (http.js:1584:20)
at TCP.onread (net.js:525:27)
If I add the following pieces to the example code it works:
request.on('end', function (results, meta) {
if(!results || !results.container) {
return;
}
// Set container object, signal async done.
and
request.on('end', function (results, meta) {
if(!results || !results.blob) {
return;
}
blobObj = results.blob;