N0taN3rd / node-warc

Parse And Create Web ARChive (WARC) files with node.js
MIT License
92 stars 20 forks source link

WARCStreamTransform can experience ERR_MULTIPLE_CALLBACK error #57

Open cmawhorter opened 1 year ago

cmawhorter commented 1 year ago

https://github.com/N0taN3rd/node-warc/blob/be3897198847fa49023ca4d09f09c0010dd98540/lib/parsers/warcStreamTransform.js#L110-L115

since _consumeChunk calls done, i think this should be:

  _flush (done) {
    if (this.buffered) {
      this._consumeChunk(this.buffered, done, true)
    } else {
      done()
    }
  }
efrazier commented 1 year ago

Hey, I just made this change because I ran into the exact error you are talking about. I was using their stream demo code and this fixed it.

samheutmaker commented 11 months ago

It looks like this repo is no longer maintained. I published a fork with this fix here, NPM package here.

npm install --save @context-labs/node-warc