binarykitchen / videomail-client

A wicked npm package to record videos directly in the browser, wohooo!
https://videomail.io
Creative Commons Zero v1.0 Universal
55 stars 19 forks source link

TypeError: "exports" is read-only #180

Closed IanPhilips closed 3 years ago

IanPhilips commented 3 years ago

Hi, love the plugin. I keep getting this error from webpack in my react-gatsby project. Any idea how I can fix it? neither of these import methods work: let VideomailClient = require('videomail-client'); import VideomailClient from 'videomail-client';

error:

TypeError: "exports" is read-only
./node_modules/videomail-client/src/js/util/browser.js/<
node_modules/videomail-client/src/js/util/browser.js:352

  349 | export default Browser
  350 | 
  351 | // so that we also can require() it from videomailError.js within
> 352 | module.exports = Browser
  353 | 

./node_modules/videomail-client/src/js/util/browser.js
http://localhost:8000/commons.js:82452:30

__webpack_require__
/Users/ianphilips/Documents/bizcoreo/webpack/bootstrap:789
binarykitchen commented 3 years ago

That's a stupid code line of me.

Removed and fixed: https://github.com/binarykitchen/videomail-client/commit/9630dab095212eb99d40f433fe19fbfef13531ac#diff-ea3f5006e5dbe3bed262fbb1df32406b19cf775152fddbe6b9123c8a8ecc6c18L352

New patch is out. Thanks for reporting. Go update now.

PS: let me know how it goes integrating into React! Never tried that before yet with this videomail-client ...