Closed MrYossu closed 2 years ago
Ah, looked in the source files and found that the reference should have been...
<script src="_content/Blazor.QRCode/qrcode.min.js"></script>
That fixed the 404, but I still get the same error when it starts scanning.
OK, found the problem.
Your embedded JavaScript contains a mistake. The qrcode-init.js
code contains the following...
}, function (errorMessage) {
DotNet.invokeMethodAsync('Blazor.QRCode', 'OnFailed',
qrCodeMessage);
Note that the function parameter is named errorMessage
but the body of the function assumes it's called qrCodeMessage
.
If you fix that, then the error goes away.
However, when I try to scan, the ErrorCallBack
C# method is called with the following message...
QR code parse error, error = TypeError: Cannot read properties of null (reading 'getContext')
At this point I got stuck. Any idea what is goingwrong?
hi, thank you for your time The main drawback was the README.md file and the publish settings. For better use, take a look at the added sample project
Thanks for sharing this, but I can't get it to work.
I followed the instructions on the main page, and added the qrcode.min.js library (as commented in issue #1, maybe you should add that to the main page), but when I try it, I get a 404 on
_content/Blazor.QRCode/qrcode.minErrorCallBack.js
.Probably as a result of this, I get the following error in the browser console when I click the "Start scanning" button...
Any ideas what's going wrong?
Thanks again.