Papa Parse worker configuration?

192 Views Asked by At

I'm using Papa Parse to read a large file (100k+ lines, and takes a couple of seconds to process). I'm following the documentation.

1st attempt: Getting CSV from a URL, wait till it finishes, then do work. Works perfectly. No problems at all. Is slow though.

Papa.parse(url, {
    download: true,
    complete: function() {
        console.log("All done!");
    }
});

2nd attempt: Getting CSV from a URL, work on it line-by-line. Works perfectly. No problems at all. Is still slow, of course.

Papa.parse(url, {
    download: true,
    step: function() {
        console.log("123...");
    }
    complete: function() {
        console.log("All done!");
    }
});

3rd attempt: Getting CSV from a URL, work on it line-by-line. Uses worker to make it not freeze. Does not work at all.

Papa.parse(url, {
    download: true,
    worker: true,
    step: function() {
        console.log("123...");
    }
    complete: function() {
        console.log("All done!");
    }
});

Without worker: true, everything works as expected. With worker: true, regardless if we use just step, just complete, or both, it stops working.

Firefox gives no error message. Chrome will say null, which is better than nothing, but does not say what is null.

Not sure what the problem is or how to fix it from here. Any advice would be appreciated.

0

There are 0 best solutions below