turkyden / react-darkreader

🌓 A React Hook for adding a dark / night mode to your site.
http://react-darkreader.turkyden.com
MIT License
279 stars 20 forks source link

Production Build Error using ViteJS #14

Closed henchicky closed 2 years ago

henchicky commented 2 years ago

I am using ViteJS, which using Rollup for production build. (instead of create-react-app - Webpack)

Works well in development, I absolutely love it. However, when building for production, and running in localhost, browser console shows this

Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Any help is appreciated, not sure if it is due to Rollup giving this error??

Below is my code, code

2021-11-25 03_43_48-Business Portal - Brave

henchicky commented 2 years ago

react-switch having issues with rollup. I changed import statement from import Switch from 'react-switch'; to import Switch from 'react-switch/dist/react-switch.dev.js';

Solved! https://github.com/vitejs/vite/issues/2139