gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.03k stars 330 forks source link

Error when trying to include vue and vue-qrcode-reader #384

Closed preoteasa closed 6 months ago

preoteasa commented 9 months ago

I have tried to include vue and vue-qrcode-reader in the head of a simple html file:

<script src="./vue.global.prod.js"></script>
<script src="./vue-qrcode-reader.umd.cjs"></script>

I believe I used the latest versions of both files. However I get the following error:

Uncaught TypeError: Ve.use is not a function at vue-qrcode-reader.umd.cjs:3:34148 at vue-qrcode-reader.umd.cjs:1:199 at vue-qrcode-reader.umd.cjs:1:233

I wrote an example inspired from the simple live demo:

https://vue-qrcode-reader.netlify.app/demos/Simple.html

But this simple demo does not seem to work either.

Sec-ant commented 9 months ago

This looks like a problem of the execution order. Can you check whether adding defer works?

<script defer src="./vue.global.prod.js"></script>
<script defer src="./vue-qrcode-reader.umd.cjs"></script>
preoteasa commented 9 months ago

It does not work. In addition I get a new error from the html body about Vue not being found.

gruhn commented 9 months ago

Sorry that "Simple" demo was broken for a while already (for various reasons). Should be fixed now. @preoteasa Can you confirm? To fix your local version you also need to upgrade to v5.4.7.

preoteasa commented 8 months ago

Thank you. I managed to run the Simple demo, and based on it, I also managed to update my example to work. I did not manage to scan a code yet, as my computer camera is quite bad and it does not focus. I have to set it up to be able to open it from the phone.

github-actions[bot] commented 6 months ago

This issue has been marked as stale. If there is no further activity it will be closed.