forgottofly
forgottofly

Reputation: 2719

Error while importing excel data using xlsx library

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.

Upvotes: 1

Views: 1125

Answers (1)

WeNeigh
WeNeigh

Reputation: 3509

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

Upvotes: 2

Related Questions