react-qr-reader
react-qr-reader copied to clipboard
Use of Adaptor.js crashing app - Require & Module.export issue - Cannot assign to read only property 'exports' of object '#<Object>
The use of web adaptor is causing Cannot assign to read only property 'exports' of object '#<Object>' errors when attempting to import the QR reader package.
This is due to mixing require with export, & import
lib/index.js: Line 28
import {adapterFactory} from './adapter_factory.js';
const adapter = adapterFactory({window});
module.exports = adapter; // this is the difference from adapter_core.
A few links to related issues:
- https://stackoverflow.com/questions/42449999/webpack-import-module-exports-in-the-same-module-caused-error
- https://github.com/webpack/webpack/issues/3997
Rolling back to v2.1.2 fixes this issue, this is pre-dependency updates that I think introduced a breaking change in webrtc-adapter or some interaction with it, related to the above issues.