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

No MultiFormat Readers were able to detect the code. #320

Open
drophit opened this issue Oct 14, 2021 · 20 comments
Open

No MultiFormat Readers were able to detect the code. #320

drophit opened this issue Oct 14, 2021 · 20 comments

Comments

@drophit
Copy link

drophit commented Oct 14, 2021

Using your demo and any bard code (all but the QR) for version 2.0.13 getting this error

No MultiFormat Readers were able to detect the code.

https://blog.minhazav.dev/QR-and-barcode-scanner-using-html-and-javascript/

file upload and see error

@micheh
Copy link

micheh commented Oct 22, 2021

I have the same problem (version 2.1.0).

With the complied version (either from the node_modules directory or from unpkg.com) is works, but with webpack it throws this error during scanning.

Stacktrace:

qrCodeErrorCallback (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#69)
scanContext (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#531)
scanContext (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#528)
foreverScan (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#559)
onplaying (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#590)
setupVideo (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#586)
onMediaStreamReceived (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#599)
onMediaStreamReceived (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#580)
start (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#152)
start (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#151)
start (webpack:///node_modules/html5-qrcode/esm/html5-qrcode.js#139)
renderCameraSelection (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#343)
renderCameraSelection (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#337)
createCameraListUi (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#197)
createCameraListUi (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#192)
createPermissionButton (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#221)
createPermissionButton (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#219)
createPermissionsUi (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#234)
createPermissionsUi (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#228)
createSectionControlPanel (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#258)
setupInitialDashboard (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#156)
createBasicLayout (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#149)
render (webpack:///node_modules/html5-qrcode/esm/html5-qrcode-scanner.js#77)

Code:

import {Html5QrcodeScanner, Html5QrcodeSupportedFormats} from 'html5-qrcode';

function onScanSuccess(decodedText, decodedResult) {
    // handle the scanned code as you like, for example:
    console.log(`Code matched = ${decodedText}`, decodedResult);
}

function onScanFailure(error) {
    // handle scan failure, usually better to ignore and keep scanning.
    // for example:
    console.warn(`Code scan error = ${error}`);
}

let html5QrcodeScanner = new Html5QrcodeScanner(
    "reader",
    {
        fps: 10,
        qrbox: {width: 250, height: 250},
        formatsToSupport: [ Html5QrcodeSupportedFormats.QR_CODE ]
    },
    false
);

html5QrcodeScanner.render(onScanSuccess, onScanFailure);

@mebjas
Copy link
Owner

mebjas commented Oct 26, 2021

@drophit Can you share the sample file being tested?

@drophit
Copy link
Author

drophit commented Oct 26, 2021 via email

@IlhamriSKY
Copy link

IlhamriSKY commented Nov 1, 2021

I have the same issue,
WhatsApp Image 2021-11-01 at 09 03 12 (1)

I am using Version 2.1.12
And this how i using it

    {!! HTML::script('assets/js/as/html5-qrcode.min.js') !!}
    <script>
        var url = '{{ route('entry.building.card', ['tokenbuliding']) }}';
        function docReady(fn) {
            // see if DOM is already available
            if (document.readyState === "complete"
                || document.readyState === "interactive") {
                // call on next available tick
                setTimeout(fn, 1);
            } else {
                document.addEventListener("DOMContentLoaded", fn);
            }
        }

        docReady(function () {
            var resultContainer = document.getElementById('qr-reader-results');
            var lastResult, countResults = 0;
            function onScanSuccess(decodedText, decodedResult) {
                if (decodedText !== lastResult) {
                    ++countResults;
                    lastResult = decodedText;
                    // console.log(`Scan result ${decodedText}`, decodedResult);
                    console.log(decodedText);
                    window.location.href = url.replace('tokenbuliding', decodedText);
                    html5QrcodeScanner.clear();
                }
            }

            var html5QrcodeScanner = new Html5QrcodeScanner(
                "qr-reader", { fps: 10, qrbox: {width: 250, height: 250}, aspectRatio: 1 });
            html5QrcodeScanner.render(onScanSuccess);
        });
    </script>

@vishakha-simply
Copy link

facing the same issue, has this been resolved @mebjas

@shadeeka
Copy link

shadeeka commented Nov 6, 2021

facing same issue with version 2.1.2
this is how i use it
`htmlCamera() {
this.html5QrcodeScanner = new Html5QrcodeScanner('qr-reader', { fps: 10, qrbox: { width: 250, height: 250 }}, false);
this.html5QrcodeScanner.render(this.onScanSuccess);
}

onScanSuccess(decodedText, decodedResult) {
console.log(MATCH = ${decodedText}, decodedResult);
}`

stacktrace
Error: Uncaught (in promise): NotFoundException: No MultiFormat Readers were able to detect the code. NotFoundException: No MultiFormat Readers were able to detect the code. at MultiFormatReader.decodeInternal (http://localhost:8100/build/0.js:22614:19) at MultiFormatReader.decode (http://localhost:8100/build/0.js:22504:25) at ZXingHtml5QrcodeDecoder.webpackJsonp.979.ZXingHtml5QrcodeDecoder.decode (http://localhost:8100/build/0.js:1720:35) at http://localhost:8100/build/0.js:1709:31 at new t (http://localhost:8100/build/polyfills.js:3:21506) at ZXingHtml5QrcodeDecoder.webpackJsonp.979.ZXingHtml5QrcodeDecoder.decodeAsync (http://localhost:8100/build/0.js:1707:16) at Html5QrcodeShim.webpackJsonp.978.Html5QrcodeShim.decodeAsync (http://localhost:8100/build/0.js:1618:29) at Html5Qrcode.webpackJsonp.966.Html5Qrcode.scanContext (http://localhost:8100/build/0.js:899:28) at Html5Qrcode.webpackJsonp.966.Html5Qrcode.foreverScan (http://localhost:8100/build/0.js:935:14) at HTMLVideoElement.videoElement.onplaying [as __zone_symbol__ON_PROPERTYplaying] (http://localhost:8100/build/0.js:966:27) at c (http://localhost:8100/build/polyfills.js:3:19752)

@troyanskiy
Copy link

Hello @mebjas

Any news on that issue?
I'm having the same error on latest 2.1.3 version.

Code:

this.html5QrcodeScanner = new Html5Qrcode(
      'barCodeReader',
      {
        verbose: true,
        formatsToSupport: [
          Html5QrcodeSupportedFormats.CODE_128,
          Html5QrcodeSupportedFormats.CODE_39,
          Html5QrcodeSupportedFormats.EAN_8
        ]
      }
    );

    this.html5QrcodeScanner.start(
      cameraId,
      {
        fps: 10,
        qrbox: {
          width: Math.round(width * 0.8),
          height: Math.round(width * 0.5),
        },
        videoConstraints: {
          advanced: [
            {
              deviceId: cameraId,
              width,
              height
            }
          ]
        }
      },
      onScanSuccess,
      onScanFailure,
    );

Stack

core.js:15724 ERROR TypeError: this.decoder.decodeAsync(...).finally is not a function
    at Html5QrcodeShim.webpackJsonp.745.Html5QrcodeShim.decodeAsync (code-decoder.js:20)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.scanContext (html5-qrcode.js:574)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.foreverScan (html5-qrcode.js:610)
    at HTMLVideoElement.videoElement.onplaying [as __zone_symbol__ON_PROPERTYplaying] (html5-qrcode.js:641)
    at HTMLVideoElement.H (polyfills.js:3)
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.js:17290)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at e.invokeTask [as invoke] (polyfills.js:3)
defaultErrorLogger @ core.js:15724
ErrorHandler.handleError @ core.js:15772
IonicErrorHandler.handleError @ ionic-error-handler.js:61
next @ core.js:17771
schedulerFn @ core.js:13515
SafeSubscriber.__tryOrUnsub @ Subscriber.js:195
SafeSubscriber.next @ Subscriber.js:133
Subscriber._next @ Subscriber.js:77
Subscriber.next @ Subscriber.js:54
Subject.next @ Subject.js:47
EventEmitter.emit @ core.js:13499
(anonymous) @ core.js:17321
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
NgZone.runOutsideAngular @ core.js:17258
onHandleError @ core.js:17321
t.handleError @ polyfills.js:3
r.runTask @ polyfills.js:3
e.invokeTask @ polyfills.js:3
p @ polyfills.js:2
v @ polyfills.js:2
core.js:15724 ERROR Error: Uncaught (in promise): NotFoundException: No MultiFormat Readers were able to detect the code.
NotFoundException: No MultiFormat Readers were able to detect the code.
    at MultiFormatReader.decodeInternal (zxing-js.umd.js:20852)
    at MultiFormatReader.decode (zxing-js.umd.js:20742)
    at ZXingHtml5QrcodeDecoder.webpackJsonp.746.ZXingHtml5QrcodeDecoder.decode (zxing-html5-qrcode-decoder.js:65)
    at zxing-html5-qrcode-decoder.js:54
    at new t (polyfills.js:3)
    at ZXingHtml5QrcodeDecoder.webpackJsonp.746.ZXingHtml5QrcodeDecoder.decodeAsync (zxing-html5-qrcode-decoder.js:52)
    at Html5QrcodeShim.webpackJsonp.745.Html5QrcodeShim.decodeAsync (code-decoder.js:20)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.scanContext (html5-qrcode.js:574)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.foreverScan (html5-qrcode.js:610)
    at HTMLVideoElement.videoElement.onplaying [as __zone_symbol__ON_PROPERTYplaying] (html5-qrcode.js:641)
    at c (polyfills.js:3)
    at polyfills.js:3
    at zxing-html5-qrcode-decoder.js:57
    at new t (polyfills.js:3)
    at ZXingHtml5QrcodeDecoder.webpackJsonp.746.ZXingHtml5QrcodeDecoder.decodeAsync (zxing-html5-qrcode-decoder.js:52)
    at Html5QrcodeShim.webpackJsonp.745.Html5QrcodeShim.decodeAsync (code-decoder.js:20)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.scanContext (html5-qrcode.js:574)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.foreverScan (html5-qrcode.js:610)
    at HTMLVideoElement.videoElement.onplaying [as __zone_symbol__ON_PROPERTYplaying] (html5-qrcode.js:641)
    at HTMLVideoElement.H (polyfills.js:3)

@hoangtrucit
Copy link

I have the same issue when I use with webpack

@ntrannghia
Copy link

Hi @mebjas, I'm also face to this issue in version 2.2.0 too

Hello @mebjas

Any news on that issue? I'm having the same error on latest 2.1.3 version.

Code:

this.html5QrcodeScanner = new Html5Qrcode(
      'barCodeReader',
      {
        verbose: true,
        formatsToSupport: [
          Html5QrcodeSupportedFormats.CODE_128,
          Html5QrcodeSupportedFormats.CODE_39,
          Html5QrcodeSupportedFormats.EAN_8
        ]
      }
    );

    this.html5QrcodeScanner.start(
      cameraId,
      {
        fps: 10,
        qrbox: {
          width: Math.round(width * 0.8),
          height: Math.round(width * 0.5),
        },
        videoConstraints: {
          advanced: [
            {
              deviceId: cameraId,
              width,
              height
            }
          ]
        }
      },
      onScanSuccess,
      onScanFailure,
    );

Stack

core.js:15724 ERROR TypeError: this.decoder.decodeAsync(...).finally is not a function
    at Html5QrcodeShim.webpackJsonp.745.Html5QrcodeShim.decodeAsync (code-decoder.js:20)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.scanContext (html5-qrcode.js:574)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.foreverScan (html5-qrcode.js:610)
    at HTMLVideoElement.videoElement.onplaying [as __zone_symbol__ON_PROPERTYplaying] (html5-qrcode.js:641)
    at HTMLVideoElement.H (polyfills.js:3)
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.js:17290)
    at t.invokeTask (polyfills.js:3)
    at r.runTask (polyfills.js:3)
    at e.invokeTask [as invoke] (polyfills.js:3)
defaultErrorLogger @ core.js:15724
ErrorHandler.handleError @ core.js:15772
IonicErrorHandler.handleError @ ionic-error-handler.js:61
next @ core.js:17771
schedulerFn @ core.js:13515
SafeSubscriber.__tryOrUnsub @ Subscriber.js:195
SafeSubscriber.next @ Subscriber.js:133
Subscriber._next @ Subscriber.js:77
Subscriber.next @ Subscriber.js:54
Subject.next @ Subject.js:47
EventEmitter.emit @ core.js:13499
(anonymous) @ core.js:17321
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
NgZone.runOutsideAngular @ core.js:17258
onHandleError @ core.js:17321
t.handleError @ polyfills.js:3
r.runTask @ polyfills.js:3
e.invokeTask @ polyfills.js:3
p @ polyfills.js:2
v @ polyfills.js:2
core.js:15724 ERROR Error: Uncaught (in promise): NotFoundException: No MultiFormat Readers were able to detect the code.
NotFoundException: No MultiFormat Readers were able to detect the code.
    at MultiFormatReader.decodeInternal (zxing-js.umd.js:20852)
    at MultiFormatReader.decode (zxing-js.umd.js:20742)
    at ZXingHtml5QrcodeDecoder.webpackJsonp.746.ZXingHtml5QrcodeDecoder.decode (zxing-html5-qrcode-decoder.js:65)
    at zxing-html5-qrcode-decoder.js:54
    at new t (polyfills.js:3)
    at ZXingHtml5QrcodeDecoder.webpackJsonp.746.ZXingHtml5QrcodeDecoder.decodeAsync (zxing-html5-qrcode-decoder.js:52)
    at Html5QrcodeShim.webpackJsonp.745.Html5QrcodeShim.decodeAsync (code-decoder.js:20)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.scanContext (html5-qrcode.js:574)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.foreverScan (html5-qrcode.js:610)
    at HTMLVideoElement.videoElement.onplaying [as __zone_symbol__ON_PROPERTYplaying] (html5-qrcode.js:641)
    at c (polyfills.js:3)
    at polyfills.js:3
    at zxing-html5-qrcode-decoder.js:57
    at new t (polyfills.js:3)
    at ZXingHtml5QrcodeDecoder.webpackJsonp.746.ZXingHtml5QrcodeDecoder.decodeAsync (zxing-html5-qrcode-decoder.js:52)
    at Html5QrcodeShim.webpackJsonp.745.Html5QrcodeShim.decodeAsync (code-decoder.js:20)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.scanContext (html5-qrcode.js:574)
    at Html5Qrcode.webpackJsonp.730.Html5Qrcode.foreverScan (html5-qrcode.js:610)
    at HTMLVideoElement.videoElement.onplaying [as __zone_symbol__ON_PROPERTYplaying] (html5-qrcode.js:641)
    at HTMLVideoElement.H (polyfills.js:3)

@halo
Copy link

halo commented Feb 24, 2022

For me, this error depends on the video width and height. If I do not restrict the video size, it reliably detects all codes without delay. If I fit the video into a div that has width and height set via CSS (say, 100px), then I cannot detect the codes, even though nothing else changed.

See also #415 (comment)

@FlyveHest
Copy link

Just started using the library today, and I am experiencing, if not the same, then a similar type of event.

I am only going to scan QR and CODE_128 codes, so I set formatsToSupport to limit it to only those two formats.

But, if I do that, then I can't scan the CODE_128 codes.

Removing the formatsToSupport setting, and I can scan the codes just fine.

@Dev-Dolphin
Copy link

Dev-Dolphin commented Sep 20, 2023

I have the same issue when I use upload file @mebjas (latest version)

@jb1232312
Copy link

jb1232312 commented Sep 20, 2023

when i put a logo design in my qr code in the center. the qr code reader is not working it's say D: No MultiFormat Readers were able to detect the code.

@gremo
Copy link

gremo commented Feb 19, 2024

Same issue here using Webpack... any workaround?

@zoernert
Copy link

I have the same issue in my code with the "No MultiFormat Readers werre able to detect the code". But... It only happens if I upload the image like:
Download (42)

If I use the camera of my device(s) it works. Reproducible on https://scanapp.org/.

The fun part is - that the same code to generate and save the QR code works with HTML5-QRCode sometimes (~50%). So I think in my case it has something todo with the generation of the QR code itself.

@Lordbufu
Copy link

Lordbufu commented Jul 30, 2024

Same problem here, regardless of how 'good' the image is (i tried loads with a variation of quality, and even used stabalizers).

The version i used is the current most updated minimized JS version (April 15 2023).

The images used are the following (also tested/replicated) in the scanapp example site), where the first is working and the second is not:
working
notWorking

The code used is very basic, as i have not moved passed templating and testing yet:

// Triggered via a onreadystatechange in my main code, non-relevant code was removed obviously.
function initBeheer() {
	html5QrcodeScanner = new Html5QrcodeScanner( "reader", { fps: 10 } );
	html5QrcodeScanner.render( onScanSuccess, onScanError );
}
	
function onScanSuccess( decodedText, decodedResult ) {
	formatName = decodedResult["result"]["format"]["formatName"];

        // Add decoded text to hidden form input.
	document.getElementById("albumS-form-isbn").value = decodedText;
	html5QrcodeScanner.clear();

	// Here i would submit the form to PhP for further processing, uncommented for troubleshooting.
	// document.getElementById("modal-form-scan").submit();

	console.log(decodedText);
	console.log(decodedResult);
}

function onScanError( errorMessage ) { console.log( errorMessage ); }

No errors on load, the default interface works, and all buttons work as expected.

When using a image, the error is console logged is the following (similar to the verbose error, minus the upscale info):

	D: No MultiFormat Readers were able to detect the code.
		at lr.decodeInternal (https://localhost/js/html5-qrcode.min.js:1:253484)
		at lr.decode (https://localhost/js/html5-qrcode.min.js:1:252382)
		at e.decode (https://localhost/js/html5-qrcode.min.js:1:299459)
		at https://localhost/js/html5-qrcode.min.js:1:299248
		at new Promise (<anonymous>)
		at e.decodeAsync (https://localhost/js/html5-qrcode.min.js:1:299213)
		at t.<anonymous> (https://localhost/js/html5-qrcode.min.js:1:305832)
		at https://localhost/js/html5-qrcode.min.js:1:304845
		at Object.next (https://localhost/js/html5-qrcode.min.js:1:304950)
		at https://localhost/js/html5-qrcode.min.js:1:303865

I hope this helps, though reading some replies, it seems like the issue causing it is known already just not solved / correctly ¿
Obvious the camera scanner works on these with no issues, its only images/photo's that it struggles with.

Kr

@ansarikhurshid786
Copy link

facing same issue. any solution ?

@JanbertCampos
Copy link

it's already been 4 years this issue was not yet resolved

@ROBERT-MCDOWELL
Copy link

ROBERT-MCDOWELL commented Oct 15, 2024

@JanbertCampos
rather than wait 4 years for the issue to be solved, why not you try to learn how to solve your issue?
git repo are open source, meaning that everyone can contribute and solve the issues, if you wish a software with support so go to buy one and you will have technical and bug support.

@justconsult-dev
Copy link

Maybe Duplicating #960

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