Uncaught DOMException: Failed to construct 'Worker': Script at papaparse.mi.js
Asked Answered
F

1

8

I tried to play with importing CSV data as xAPI Statement in LRS. I tired to followed the step stated. But i cannot fletch the data. It throws a error." Uncaught DOMException: Failed to construct 'Worker': Script atUncaught DOMException: Failed to construct 'Worker': Script at papaparse.min.js

Here is the github link for it which i tried. https://github.com/mariocoski/csv-to-xapi

This is the error that i am getting papaparse.min.js:6 Uncaught DOMException: Failed to construct 'Worker': Script at 'file:///Users/dassintern/Documents/ayash/csv-to-xapi-master/js/lib/papaparse.min.js?papaworker' cannot be accessed from origin 'null'. at f (file:///Users/dassintern/Documents/ayash/csv-to-xapi-master/js/lib/papaparse.min.js:6:11265) at Object.t [as parse] (file:///Users/dassintern/Documents/ayash/csv-to-xapi-master/js/lib/papaparse.min.js:6:91) at HTMLInputElement. (file:///Users/dassintern/Documents/ayash/csv-to-xapi-master/js/csv-parser-extension.js:60:8) at HTMLInputElement.dispatch (https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js:3:8549) at HTMLInputElement.r.handle (https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js:3:5252)

Ferriferous answered 8/4, 2019 at 23:45 Comment(0)
U
17

If you are seeing this in Chrome then the answer probably has to do with loading from a local filesystem rather than over HTTP. The key is the message "cannot be accessed from origin 'null'" where a local file:// load will have a null origin. See Chrome can't load web worker.

Uncontrollable answered 9/4, 2019 at 12:34 Comment(3)
Thank you, its because Chrome doesn't let you load web workers when running scripts from a local file. Used XAMP but its does work in firefox as well. Thank you again mate!!Ferriferous
@Brian In my case, I am trying to implement the dos program using js-dos, But I am stuck over this construct worker issue, it's neither working from localhost, UAT, nor live server.Solidus
Try modifying your local browser option, for instance in firefox changing the security.fileuri.strict_origin_policy remove this problem.Scrapple

© 2022 - 2024 — McMap. All rights reserved.