TooTallNate / node-icy

Node.js module for parsing and/or injecting ICY metadata
MIT License
291 stars 48 forks source link

TypeError: Cannot read property 'blue' of undefined #1

Closed onyxmueller closed 13 years ago

onyxmueller commented 13 years ago

This is the error thrown after git'ing your repository and running basic.js out of the box. I believe the use of the colors node module is incorrect. Stack trace below:

TypeError: Cannot read property 'blue' of undefined at /Users/onyx/temp/node-icecast-stack/examples/basic/basic.js:31:37 at Array.forEach (native) at Client. (/Users/onyx/temp/node-icecast-stack/examples/basic/basic.js:30:18) at Client.emit (events.js:59:20) at HttpRequestStack.emit (/usr/local/lib/node/.npm/stream-stack/1.1.0/package/stream-stack.js:196:23) at HttpRequestStack._onHeadersComplete (/usr/local/lib/node/.npm/http-stack/0.0.2/package/lib/http-stack.js:92:8) at HttpRequestStack._onData (/usr/local/lib/node/.npm/http-stack/0.0.2/package/lib/http-stack.js:63:12) at Socket. (native) at Socket._origEmit (events.js:59:20) at Socket.emit (/usr/local/lib/node/.npm/stream-stack/1.1.0/package/stream-stack.js:191:28)

onyxmueller commented 13 years ago

When I attempted to remove the color logic from the problem area and tried to re-run, I got the following error:

Connected to: 2133.live.streamtheworld.com:80 Sending HTTP Request for: http://2133.live.streamtheworld.com:80/KFRCFMCMP3 HTTP Response Headers Received: undefined: undefined undefined: undefined undefined: undefined undefined: undefined undefined: undefined undefined: undefined undefined: undefined undefined: undefined undefined: undefined undefined: undefined /usr/local/lib/node/.npm/icecast-stack/0.2.1/package/lib/icecast-stack.js:274 rtn[piece[0]] = piece[1].substring(0, piece[1].length-1); ^ TypeError: Cannot read property 'length' of undefined at Object.parseMetadata (/usr/local/lib/node/.npm/icecast-stack/0.2.1/package/lib/icecast-stack.js:274:53) at Client. (/Users/onyx/temp/node-icecast-stack/examples/basic/basic.js:41:24) at Client.emit (events.js:42:17) at Client. (/usr/local/lib/node/.npm/icecast-stack/0.2.1/package/lib/icecast-stack.js:89:10) at Client. (/usr/local/lib/node/.npm/icecast-stack/0.2.1/package/lib/icecast-stack.js:22:12) at HttpRequestStack. (native) at HttpRequestStack._origEmit (events.js:59:20) at HttpRequestStack.emit (/usr/local/lib/node/.npm/stream-stack/1.1.0/package/stream-stack.js:191:28) at HttpRequestStack._onData (/usr/local/lib/node/.npm/http-stack/0.0.2/package/lib/http-stack.js:71:10) at Socket. (native)
TooTallNate commented 13 years ago

Thanks for noticing. I'm looking into it now... Also, which version of node are you using? master branch?

onyxmueller commented 13 years ago

In order to install node-icecast-stack via npm (to address any dependencies), I had to use a node version 0.3.x...according to the error message I got from npm. So, I went with the latest (unstable) version of node, which is 0.3.5.

TooTallNate commented 13 years ago

Indeed, node-icecast-stack is only compatible with >= 0.3.0. Silly question of me :P

Anyway, this seems to be a tougher problem than I could figure out quickly. I'm not exactly sure what's changed, but it definitely used to work. Something might have changed with Node's API or something. I'm still looking into it...

TooTallNate commented 13 years ago

Ok, figured it out!

I hadn't pushed some changes in the http-stack repo to npm in a while, but that's what was needed.

Please run:

npm update http-stack

and all should work well :)

onyxmueller commented 13 years ago

It worked like a charm. Thanks for your quick turnaround in resolving this. You da man!