Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

306
Visualizações
QR code scanner doesn't read the library from the source file but works when importing it from another website

I'm working on implementing the QR code scanner using source code I found on this website: https://www.sitepoint.com/create-qr-code-reader-mobile-website/

and modifying the project that already exists in the codesandbox: https://codesandbox.io/s/qr-code-scanner-ilrm9?file=/src/qrCodeScanner.js

The above example relies on library stored on on another website. I want to create a web application where all the libraries are stored locally as source files. I created a project and downloaded the library as provided: https://raw.githubusercontent.com/sitepoint-editors/jsqrcode/master/src/qr_packed.js

Then I included the library in the project as qr_packed_download.js. I changed only the CSS and left most of the HTML the same as the original. When I try implementing the library from the source file, the scanner doesn't work. I get an error at qrCodeScanner.js line 13:

Cannot set properties of undefined (setting 'callback')

I'm assuming it means the library isn't loaded at the time the scanning script is executed. I made no changes to either. Even the original project doesn't work when I reference the library as a file rather than a website. Could anyone help me out with this?

Here's the link to my project: https://codesandbox.io/s/scannergui-forked-5l8q2

There are 3 html files, 2 scanners and one GUI. scanner_screen is the same as the original and works fine. scanner_bottle involves the library as a javascript file and doesn't work. This link will prompt you to a GUI. Clicking on either of the icons opens the scanner interface.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda