react-confirm-alert
react-confirm-alert copied to clipboard
Doesn't work with "Vite"
Once installed and using this package the project breaks with this error ...
✘ [ERROR] Could not resolve "prop-types"
node_modules/react-confirm-alert/lib/index.js:20:25:
20 │ var _propTypes = require('prop-types');
╵ ~~~~~~~~~~~~
You can mark the path "prop-types" as external to exclude it from the bundle, which will remove
this error. You can also surround this "require" call with a try/catch block to handle this
failure at run-time instead of bundle-time.
I'm using vite, not Create React App (CRA), and using typescript.
Same issue here :') any fix for that? Thanks.
btw you can do this npm install --save prop-types
btw you can do this
npm install --save prop-types
This worked for me.