Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Worker #133

Closed
ngoding-bro opened this issue Oct 18, 2021 · 2 comments
Closed

Error on Worker #133

ngoding-bro opened this issue Oct 18, 2021 · 2 comments

Comments

@ngoding-bro
Copy link

I have tried what you gave me, And I get an error (Worker is not defined) where should I justify it?

@ngoding-bro
Copy link
Author

even i've seen permission #11 and it's not working..
the path I used ./node_modules/qr-scanner/qr-scanner-worker.min.js

@danimoh
Copy link
Member

danimoh commented Feb 4, 2022

As described in the readme, WORKER_PATH had to point to the location where the worker script is hosted, e.g. relative to the index.html or as an absolute URL, not to a path in your source code, see

qr-scanner/README.md

Lines 82 to 87 in 3ce4f1b

### Setting up the worker
`qr-scanner-worker.min.js` is a plain Javascript file for the separate worker thread and needs to be copied over to your project. You should then point `QrScanner.WORKER_PATH` to the location where it will be hosted:
```js
QrScanner.WORKER_PATH = 'path/to/qr-scanner-worker.min.js';
```

However, the api has been simplified now.
Specifying the WORKER_PATH is not required anymore in the newest release, have a look at the new readme :)

@danimoh danimoh closed this as completed Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants