Closed Nuruddinjr closed 5 years ago
post your ./node_modules/libphonenumber-js/es6/metadata.js
As you can see, getCountryCallingCode
is exported from ./metadata
.
https://unpkg.com/libphonenumber-js@1.7.5/es6/metadata.js
export function getCountryCallingCode(country, metadata) {
metadata = new Metadata(metadata);
if (!metadata.hasCountry(country)) {
throw new Error('Unknown country: ' + country);
}
return metadata.country(country).countryCallingCode();
}
My tests also work.
It could be a bug in a bundler you're using.
Or maybe something's messed up in the node_modules
fodler.
I was using 1.6.9 version of library, when I upgraded to 1.7.5 this error comes up.