0

I have reinstalled my web app in a new server without changing anything and now I receive this error:

TypeError: QRCode.drawBitArray is not a function

why? i haven't change my code....

this is the library : https://github.com/simwood/node-qrcode

and yess, i have install all the dependencies.

alternatively, do I recommend libraries that return an array with the length of the line?

sorry for bad english(:

ndmeiri
  • 4,979
  • 12
  • 37
  • 45
Alessandro Zago
  • 793
  • 3
  • 12
  • 33

2 Answers2

1

drawBitArray has been removed in the last version of qrcode. The official repo seems to be here and the last version with the function is 0.7.1.

In the last version (at this time 1.4.4) you can obtain the array of bits and the size returned by drawBitArray this way:

const myQrCode = qrcode.create("myContent")
const bits = new Uint8Array(myQrCode.modules.data)
const QrLineSize = myQrCode.modules.size
Pierre Maoui
  • 5,976
  • 2
  • 27
  • 28
0

run this npm install --save node-qrcode

if that doesnt work try deleting node_modules folder and running that command again.

also check the version of node-qrcode that are installed in your package.json file. make sure theyre consistant with eachother

Matt Pengelly
  • 1,480
  • 2
  • 20
  • 34