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

Uncaught TypeError: libphonenumber_js_1.AsYouType is not a constructor

rattkin opened this issue · comments

All my apps work well with libphonenumber-js@1.9.52
When I update any of them to version 1.10.13, I get this runtime error each time phone input with asYouType is displayed.

Uncaught TypeError: libphonenumber_js_1.AsYouType is not a constructor

All my apps use react 17.0.x (different patch versions)

This seems to be an import issue, or something like that.

Inspect libphonenumber_js_1.AsYouType to see what it is.
Inspect libphonenumber_js_1 to see what it is.

temporary workaround:

  "resolutions": {
        "react-phone-number-input": "3.1.52"
        "libphonenumber-js": "1.9.52"

Checking in here to say I've been having the exact same problem (on 1.10.13) and downgrading as @rattkin suggests has fixed my issue as well. (Cheers @rattkin!)

It's still not fixed in 1.10.34 so we had to downgrade too. Thanks, @rattkin

For some context, this only happens in the production build and works fine locally during development. The error only appeared after upgrading to React 17.0.x and webpack 5.

Are there any plans to look into this?