PapaParse
PapaParse copied to clipboard
Error using transformHeader with header: true and worker: true
The error was about not being able to clone in postMessage.
I was working with a remote csv in a Chrome Web Front End.
could you post the full tracebak?
I've provided the example function as well and removed private details.
Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Worker': (h) => {
return h.trim();
} could not be cloned.
at Object.parse (chrome-extension://asfdasdf/background/background.js:35623:967)
at chrome-extension://asfdasdf/background/background.js:46081:18
at new Promise (<anonymous>)
at Function.loadCsvRules (chrome-extension://asfdasdf/background/background.js:46079:16)
private static async loadCsvRules(csvUrl: string): Promise<any[]> {
return new Promise( (resolve, reject) => {
const datas = [];
Papa.parse(csvUrl, {
download: true,
header: true,
worker: true,
transformHeader: (h) => {
return h.trim();
},
step: (row) => {
datas.push(row.data);
},
complete: () => {
resolve(datas);
}
});
});
}
I'm having this same problem as well. Any suggestions on how to resolve this?
Having the same issue over here. Would love to find a workaround for this.
Same here...
Is there any update with this issue? I'm seeing this problem too
👍 on this, it seems like transformHeader
is incompatible with worker: true
which really stinks. Even
transformHeader: header => header
seems like it fails; assuming the function is being passed to the worker and simply cannot be serialized.
Might at least want to update the documentation to reflect this; did not see it referenced.
Just so as not to poo all over an amazing project: PapaParse is really excellent and has proven utterly invaluable, so thanks for such an awesome tool 🎊
I'm a new PapaParse user, and I wish this were fixed or documented. It would have saved me some time. The last message was over a year ago, and I hate to beat a dead horse, but is there any update on this issue?
Same thing happen to me but with transform
and not transformHeader
, it seems that the error is the same.