react-confirm-alert icon indicating copy to clipboard operation
react-confirm-alert copied to clipboard

Doesn't work with "Vite"

Open Shaker-Pelcro opened this issue 2 years ago • 2 comments

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.

Shaker-Pelcro avatar Nov 05 '22 16:11 Shaker-Pelcro

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

robvan2 avatar Dec 14 '22 11:12 robvan2

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

This worked for me.

asama-sama avatar Apr 06 '23 23:04 asama-sama