react-qr-reader icon indicating copy to clipboard operation
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>

Open RyRy79261 opened this issue 6 years ago • 2 comments

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.

RyRy79261 avatar May 21 '19 14:05 RyRy79261

A few links to related issues:

  1. https://stackoverflow.com/questions/42449999/webpack-import-module-exports-in-the-same-module-caused-error
  2. https://github.com/webpack/webpack/issues/3997

BenSchZA avatar May 21 '19 15:05 BenSchZA

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.

BenSchZA avatar May 21 '19 16:05 BenSchZA