Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: libphonenumber_js_1.AsYouType is not a constructor #429

Open
rattkin opened this issue Aug 29, 2022 · 5 comments
Open

Comments

@rattkin
Copy link

rattkin commented Aug 29, 2022

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)

@rattkin
Copy link
Author

rattkin commented Aug 29, 2022

@catamphetamine
Copy link
Owner

catamphetamine commented Aug 30, 2022

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.

@rattkin
Copy link
Author

rattkin commented Aug 31, 2022

temporary workaround:

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

@efost
Copy link

efost commented Sep 15, 2022

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

@juliankigwana
Copy link

juliankigwana commented Jun 6, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants