7

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)

text
  • 93
  • 1
  • 1
  • 5

1 Answers1

15

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.

Brian J. Miller
  • 2,169
  • 1
  • 12
  • 12
  • 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!! – text Apr 11 '19 at 05:36
  • @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. – B-shan Aug 06 '21 at 16:07
  • Try modifying your local browser option, for instance in firefox changing the security.fileuri.strict_origin_policy remove this problem. – Alexandre Mazel Feb 14 '22 at 11:39