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

Uncaught (in promise) Camera not found. #20

Closed
Dharit opened this issue Jan 9, 2019 · 2 comments
Closed

Uncaught (in promise) Camera not found. #20

Dharit opened this issue Jan 9, 2019 · 2 comments

Comments

@Dharit
Copy link

Dharit commented Jan 9, 2019

Facing issue like this it was showing wrong path for qr-scanner-worker.min.js also faced some other issue solved them but not able to solve this one. If anyone here have solution for this please guide me.

@gmiller-in-situ
Copy link

I had a similar issue in my first implementation. The issue is that scanner.start() returns a promise which can be rejected if the camera cannot be accessed. You need to handle that rejection like so:

this.scanner.start().then(
    () => {
        this.hasCamera = true;
    },
    (error) => {
        console.log(error);
        this.hasCamera = false;
    }
);

@danimoh
Copy link
Member

danimoh commented Jul 9, 2020

Exactly as @gmiller-in-situ says 👍

@danimoh danimoh closed this as completed Jul 9, 2020
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

3 participants