webrtcHacks / adapter

Shim to insulate apps from spec changes and prefix differences. Latest adapter.js release:
https://webrtcHacks.github.io/adapter/adapter-latest.js
BSD 3-Clause "New" or "Revised" License
3.63k stars 845 forks source link

Cannot assign to read only property exports of object #944

Closed bumi001 closed 3 years ago

bumi001 commented 5 years ago

Please read first!

Please use discuss-webrtc for general technical discussions and questions.

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed.

Versions affected

Browser name including version (e.g. Chrome 64.0.3282.119) Version 73.0.3683.103 (Official Build) (64-bit)

adapter.js (e.g. 6.1.0) 7.2.2

Description

I include it like import adapter from 'webrtc-adapter'

Steps to reproduce

Insert the above line in any reactjs component

Expected results

Component should load

Actual results

The app doesn't load. It displays: Uncaught TypeError: Cannot assign to read only property 'exports' of object '#'

RyRy79261 commented 5 years ago

Getting the exact same issue

fippo commented 5 years ago

https://github.com/webrtcHacks/adapter/pull/948 should fix that but we're currently waiting on the tests to become more green before publishing a new version.

RyRy79261 commented 5 years ago

@fippo The issue I'm getting is that another package I'm using is calling this in a require statement, I'm guessing taking that approach would cause this issue?

fippo commented 5 years ago

ah... is this not #948. Sounds like an issue with the bundler, which one is used?

RyRy79261 commented 5 years ago

@fippo So I was using a react qr scanner, and what happened was when you target this with require it automatically targeted adapter5 or something rather than core which used export.

Resulting in this issue at compile in webpack.

fippo commented 3 years ago

hoping this isn't an issue anymore, please holler if that is wrong

bumi001 commented 3 years ago

I agree that this issue is resolved. In my package.json, I have: "webrtc-adapter": "7.7.0"

On Fri, Jan 15, 2021 at 3:39 AM Philipp Hancke notifications@github.com wrote:

hoping this isn't an issue anymore, please holler if that is wrong

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/webrtcHacks/adapter/issues/944#issuecomment-760784387, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADL6IMH4DBSGIZA76IQ5FPLS2AEMDANCNFSM4HECHRYA .