react-papaparse
react-papaparse copied to clipboard
readString: An argument for 'config' was not provided
I've been using this library for a while but from today it started throwing an error at readString(). I have this const parsedCsv = readString(csvString); from which, later on, I grab parsedCsv.data and parsedCsv.meta.delimiter for my purposes. But now, I can't do that as I get an error that says An argument for 'config' was not provided.. Is there a way to set this config to null and retrieve this data without readString(str, {worker: true, complete: res => someVar = res.data, someDelimiterVar = res.meta.delimiter}) etc. because on this way I should be dealing with async/await if I'd like to assign the data I need to my values, which I'd like to avoid.
@sunrisep12
readString API has been changed in latest version 3.18.0 as following:
readString(csvString, {
worker: true,
complete: (results) => {
console.log(results)
}
})
Getting same error trying to use readRemoteFile, what is the fix/workaround? Sorry very limited React knowledge, don't really understand what the above response means. Config is not being recognised at all, nor can I leave it blank although documentation says its 'optional'.
Edited Today (24/11) I rolled my install back to version 3.17.2 and the problem went away, its a bug.
@flowerbot @sunrisep12
radString API has been changed from:
const parsedCsv = readString(csvString, { worker: true });
To
readString(csvString, {
worker: true,
complete: (parsedCsv) => {
console.log(parsedCsv);
}
});
I was also struggling with this after the update. Looks like the docs are not up to date here https://react-papaparse.js.org/docs#strings.
Also, why is worker a required prop if it should be always true, in this case?