react-carousel: App throws error on Building with npm run build

Describe the bug After I build my app which is using react-carousel for production using npm run build, it gives an error when I try to open the page where react-carousel is used. The error screenshots are provided below

Expected behavior To render the page as it appears during development.

Screenshots image

Environment

  • node 14.4.0, npm 6.14.5, react-carousel 2.0.1
  • Desktop Windows 10
  • Edge, Chrome

Please look into this. Its a great library and the best one for my purpose but this error blindsided me.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 14
  • Comments: 20 (9 by maintainers)

Most upvoted comments

@mnelemans what’s the right way to install the latest commit from your PR?

I can’t find a way to do that.

I got this working by

  1. Clone @mnelemans 's fork
  2. yarn
  3. yarn build
  4. Copy the contents of react-carousel/lib into my project’s node_modules/@brainhubeu/react-carousel/lib folder and overwriting the existing files.

After rebuilding my create-react-app project, everything seems to work.

Please merge that PR, this is quite annoying bug

Please try again with the latest commit (https://github.com/brainhubeu/react-carousel/pull/646/commits/7815c7e3745a4198a71eb7c7648f638236dd45a0) in my PR. It seems bumping recoil to at least ^0.0.11 fixes the read-only issue, while setting webpack to use production mode correctly ensures it reads from the production version.