ZJONSSON / parquetjs

fully asynchronous, pure JavaScript implementation of the Parquet file format
MIT License
34 stars 61 forks source link

Fix multiple callback calls #87

Open jakedaleweb opened 1 year ago

jakedaleweb commented 1 year ago

This library is incompatible with newer node versions (~16+) which throw an error when the callback is called more than once. The way this library currently works it is always going to call the callback within the close method and then in the then call afterwards resulting in

Error [ERR_MULTIPLE_CALLBACK]: Callback called multiple times
    at NodeError (node:internal/errors:400:5)
    at onFinish (node:internal/streams/writable:671:37)
    at node:internal/streams/transform:147:9
    at /app/node_modules/parquetjs-lite/lib/writer.js:321:18
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

In the process of testing this fix at the moment.. will report back.