harish-everest / react-phone-input-mui

Highly customizable phone :telephone_receiver: input component with auto formatting
MIT License
24 stars 13 forks source link

Vite react issue #130 #12

Open nerijusgood opened 2 years ago

nerijusgood commented 2 years ago

Using viteJs after build and compression package always triggers:

instrument.js:109 Error: 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.

harish-everest commented 2 years ago

Did you verify that the build is passing after removing this package from your app?

Bramvanosta commented 2 years ago

I had the same issue using Vite. I found a comment on an issue on the original package which fixed it for me:

import _PhoneInput from 'react-phone-input-material-ui';

export const PhoneInput = (_PhoneInput as any).default
  ? ((_PhoneInput as any).default as typeof _PhoneInput)
  : _PhoneInput;

There is an open PR as well which supposedly fixes the issue but I haven't tested it.

harish-everest commented 2 years ago

Thanks @Bramvanosta.

@nerijusgood please use this workaround till I test the fix.