catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript

Home Page:https://catamphetamine.gitlab.io/libphonenumber-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken exports in libphonenumber-js/max

Dylan-Floyd opened this issue · comments

Hello, I don't have time to investigate the cause thoroughly at the moment, but the changes in 1.10.x seem to have broken exports. I can't import parsePhoneNumber or parsePhoneNumberWithError in a Create React App (esm I believe), I get "TypeError: parsePhoneNumberWithError is not a function". This was happening on 1.10.7 specifically, and the problem doesn't happen with 1.9.x.

I'll try to provide more detailed info tonight.

And specifically the issue was in a dependency of the Create React App that I control. So our CRA app imports the dependency, and the dependency imports parsePhoneNumberWithError. The dependency uses CJS.

Not sure if this is relevant, but I wanted to include it just in case