"undefined is not a function" when running decoder example #4

Open
rfwatson opened this Issue Mar 5, 2013 · 5 comments

Projects

None yet

4 participants

@rfwatson
rfwatson commented Mar 5, 2013

Firstly, thanks for your work on this library.

I'm running into this issue both in my own code, and also when I run the decoder example "out-of-the-box" on node 0.9.11.

/xyz/streamcoder/node_modules/ogg/lib/decoder-stream.js:151
    fn(null, packet);
    ^
TypeError: undefined is not a function
    at DecoderStream.onpacket (/xyz/streamcoder/node_modules/ogg/lib/decoder-stream.js:151:5)
    at DecoderStream.g (events.js:192:14)

It looks like the stream _read method has been extended to expect a second argument, a function, but it is still being called with a single argument from somewhere, which is causing it to crash.

I couldn't get it working with 0.8.21 either (the same problem if I remember correctly).

Any idea what I could do to fix this?

@rfwatson
rfwatson commented Mar 5, 2013

Actually running the mocha tests also all fail with the same error-

  ․․․․․

  ✖ 5 of 5 tests failed:

  1) Decoder pipershut_lo.ogg should emit at least one "readable" event:
     TypeError: undefined is not a function
      at DecoderStream.onpacket (/xyz/streamcoder/node_modules/ogg/lib/decoder-stream.js:152:5)
      at DecoderStream.g (events.js:192:14)
      at DecoderStream.EventEmitter.emit (events.js:91:17)
      at afterPacketout (/xyz/streamcoder/node_modules/ogg/lib/decoder-stream.js:119:12)

... etc
@rfwatson
rfwatson commented Mar 5, 2013

This only affects 0.9.11, it works in 0.9.8. Will leave this ticket open in case you were unaware of this

@rfwatson rfwatson closed this Mar 5, 2013
@TooTallNate TooTallNate reopened this Mar 5, 2013
@TooTallNate
Owner

Ya thanks, this has to do with the Readable stream API change that was introduced in v0.9.11. I'm planning on updating to the new API whenever I get a chance (hopefully some time today!).

@arunoda
arunoda commented Apr 9, 2013

hope PR #5 will fix it

@andrewrk

Still an issue in Node.js v0.10.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment