react-qr-reader
react-qr-reader copied to clipboard
Cannot read properties of null (reading: 'videoWidth') - Windows
Hello everyone,
I started using the react-qr-reader library and for v2.2.0 and v2.2.1 I have a problem with the library, in the index.js file it gives me an error on line 277, the line contains this
var width = Math.floor (legacyMode ? img.naturalWidth : preview.videoWidth);
The problem is after rendering something other than the qr reader component, the "preview" object becomes null and hence the error, while the qr component is being rendered I don't receive anything, I want to make a the interface for reading QR codes and I have some cancel buttons in case you don't want to read the codes and replace the frame with the camera with something else. Also I got this problem on windows laptops, on Linux everything seems to be ok.
Facing the same issue
We are also getting the same issue. We did nothing except update packages recently and this error has started to appear since moving to this version.
Actually scratch that - in fact this package hasn't updated but the error has only started to occur recently so perhaps an issue in other depedancies is causing this?
I experienced an issue only on localhost. When the app was deployed, this issue didn't occur anymore.
I'm also facing this issue. Any update on this?