I am calling Papa.parse in my own worker and in _config.worker is set false.
When process completes it calls postMessage still that triggers a message to my own worker.
Shouldn't this
if (IS_PAPA_WORKER)
{
global.postMessage({
results: results,
workerId: Papa.WORKER_ID,
finished: finishedIncludingPreview
});
}
Should also check if config.worker is set to true then only call global.postMessage
I don't want to send results to main thread any idea how can i achieve it ?
They do define
IS_PAPA_WORKERtoThis means they do check is there is no
documentproperty, apostMessageproperty, and if the current realm has been loaded from ablob:URI.The best solution in your case is probably to not load your script from a
blob:URI, but instead use a dedicated script file.Here is a demo using a
data:URI, since StackSnippets don't allow storage of files, but don't usedata:URIs yourself, it's just for demo the protocol matters:Now if you absolutely need to use a
blob:URI, the simplest solution is to definedocumentas a truthy global property before you import the library: