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.76k stars 218 forks source link

Broken exports in libphonenumber-js/max #426

Open Dylan-Floyd opened 2 years ago

Dylan-Floyd commented 2 years ago

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.

Dylan-Floyd commented 2 years ago

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

catamphetamine commented 2 years ago

Hi. I won’t investigate it either but if you happen to find a cause you could post it here.

On Thu, 30 Jun 2022 at 01:03, Dylan Floyd @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/catamphetamine/libphonenumber-js/issues/426#issuecomment-1170538199, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADUP3YVTT5GHRQWRYFV7D3VRTB2XANCNFSM52HHKZ7A . You are receiving this because you are subscribed to this thread.Message ID: @.***>