Closed arnaudjnn closed 4 years ago
I have a pretty similar error, when using parser.pause()
and parser.resume()
inside the step function. I have set worker: false
inside my config.
@arnaudjnn It looks like your input data is too large for your system to hold in memory. When you specify a step
function, you enable the tool's streaming mode, so it releases objects as it parses.
@pip77 I saw this too specifically while using a Node.js stream as input. Pausing that stream in addition to the parser solved the problem for me.
'use strict';
const fs = require('fs');
const papaparse = require('papaparse');
const inFile = fs.createReadStream(process.argv[2], {encoding: 'utf-8'});
papaparse.parse(inFile, {
async chunk(row, parser) {
if (row.errors.length) {
console.error(row);
return;
}
parser.pause();
+ inFile.pause();
await new Promise((resolve) => setTimeout(resolve, 2000));
+ inFile.resume();
parser.resume();
}
});
I'm closing this issue because there is nothing that we need to fix on PapaParse.
Thanks to all for sharing their experiences and solutions.
return the following error:
It works if I add to config:
Why I get this?