jimhigson / oboe.js

A streaming approach to JSON. Oboe.js speeds up web applications by providing parsed objects before the response completes.
http://oboejs.com
Other
4.77k stars 209 forks source link

Streams broken as of NodeJS 10.20.1 #216

Open crh3675 opened 3 years ago

crh3675 commented 3 years ago

Streams just hang using NodeJS 10x:

const readStream = new stream.PassThrough();
readStream.end('{"stations":[{"id":1,"name":"somewhere"]}');

readStream.once('readable', () => {
  oboe(readStream).node('stations.*', station => {
     // Never iterates
  })
  .done(final => {
    // Never is done
  })
  .fail(err => {
    // Never fails
  });
});

Cannot reproduce in NodeJS versions < 8. Even tried with NodeJS 10.x version:

const readable = Readable.from('{"stations":[{"id":1,"name":"somewhere"]}', {encoding: 'utf8'});
SheldonWBM commented 2 months ago

FYI: Using Oboe on node 20.x, no hanging issues.