GA-MO / react-confirm-alert

react component confirm dialog.
https://ga-mo.github.io/react-confirm-alert/demo/
MIT License
274 stars 105 forks source link

Doesn't work with "Vite" #85

Open Shaker-Pelcro opened 2 years ago

Shaker-Pelcro commented 2 years ago

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.

robvan2 commented 1 year ago

Same issue here :') any fix for that? Thanks. btw you can do this npm install --save prop-types

asama-sama commented 1 year ago

btw you can do this npm install --save prop-types

This worked for me.