1
votes

I'm trying to import excel data into my angular app using this library:

xlsx

But when I downloaded the project and tried to run locally,when uploading the excel file I'm getting this error:

Uncaught SecurityError: Failed to construct 'Worker': Script at 'file:///E:/Experiments/js-xls-master/xlsworker2.js' cannot be accessed from origin 'null'. Has anyone faced similar kind of issues or have used this library request you to share the thoughts for the above problem.

1

1 Answers

2
votes

You cannot run a WebWorker from a file:// URL

A simple workaround is to run a local HTTP server in your project directory and access the site from the http URL

python -m SimpleHTTPServer

Your site will be available at http://0.0.0.0:8000