libphonenumber-js icon indicating copy to clipboard operation
libphonenumber-js copied to clipboard

Uncaught TypeError: libphonenumber_js_1.AsYouType is not a constructor

Open rattkin opened this issue 2 years ago • 6 comments

All my apps work well with [email protected] 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)

rattkin avatar Aug 29 '22 13:08 rattkin

might be related to https://github.com/catamphetamine/libphonenumber-js/issues/426 or https://github.com/catamphetamine/libphonenumber-js/issues/425 or https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/147

rattkin avatar Aug 29 '22 13:08 rattkin

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.

catamphetamine avatar Aug 30 '22 11:08 catamphetamine

temporary workaround:

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

rattkin avatar Aug 31 '22 08:08 rattkin

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!)

efost avatar Sep 15 '22 23:09 efost

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?

juliankigwana avatar Jun 06 '23 16:06 juliankigwana

I am still seeing the same error in the latest version. Looks like this ticket is open from a long time. Any plans on fixing this anytime in the future?

strikeraj72 avatar Jul 10 '24 23:07 strikeraj72