Skip to content

Conversation

@Geovanek
Copy link

After updating the plugin
https://github.com/jackocnr/intl-tel-inputf
to the latest version, the following error started to appear:

Uncaught TypeError: Cannot set properties of undefined (setting 'autoCountry')

After researching this field in the files and doing some tests, by commenting out the line in the modified file below, everything started working normally again.

@Saifallak
Copy link

having same issue, any updates on merging this ?

@draskog
Copy link

draskog commented Dec 8, 2024

You should rename in script window.intlTelInputGlobals.autoCountry to window.intlTelInput.autoCountry

@q--
Copy link

q-- commented Jan 7, 2025

For those looking to make this work, the easiest way is to change your script loading int-tel-input from something like

import intlTelInput from "intl-tel-input/intlTelInputWithUtils";

window.intlTelInput = intlTelInput;

to

import intlTelInput from "intl-tel-input/intlTelInputWithUtils";

window.intlTelInput = window.intlTelInputGlobals = intlTelInput;

so explicitly making window.intlTelInputGlobals an alias of window.intlTelInput.

(If that doesn't work and you don't know JavaScript well enough to make it work, just doing window.intlTelInput = window.intlTelInputGlobals; anywhere after loading intlTelInput also should work.)

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

Successfully merging this pull request may close these issues.

5 participants