I am trying to use react-phone-input-2 library with react+vite, but during build its throwing an error

238 Views Asked by At
✓ 656 modules transformed.
[vite]: Rollup failed to resolve import "react-phone-input-2/dist/lib/style.css" from "/src/components/MobilePhoneInput/MobilePhoneInput.jsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:

Getting above error while creating react production build

I am using react + vite

0

There are 0 best solutions below