catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.79k stars 216 forks source link

Can't resolve 'libphonenumber-js/metadata.min' #199

Closed gbaasch closed 6 years ago

gbaasch commented 6 years ago

when importing

import Phone from 'react-phone-number-input';

I get the following error

Can't resolve 'libphonenumber-js/metadata.min' in '/Users/Gaby/Documents/react-app/node_modules/react-phone-number-input/modules'

I've tried installing and upgrading dependencies with no luck. Using React 16

catamphetamine commented 6 years ago

Basically it's https://github.com/catamphetamine/react-phone-number-input#module-not-found-error-cant-resolve-libphonenumber-jsmetadatamin In short, your bundler doesn't resolve *.json file extension. If you're using Webpack, see the link for the fix. Otherwise name your bundler.

nickoneill commented 6 years ago

Did you find a fix for this? I have .json in my resolved extensions list but still getting this while running snapshot tests for components that import libphonenumber-js for validation.