'Uncaught SyntaxError: Invalid regular expression [intlTelInput]

I am trying to use intl-tel-input in Asp.net core 6.0 razor pages Here is my Scripts

     $(document).ready(function(){
        $('#tbxPhone').intlTelInput();
    });

But gives an error

Errors in console;

intlTelInput.js:10 Uncaught SyntaxError: Invalid regular expression: /^[a-zA-ZÀ-ÿ ]$/: Range out of order in character class

jquery-3.1.1.min.js:2 jQuery.Deferred exception: $(...).intlTelInput is not a function TypeError: $(...).intlTelInput is not a function
at HTMLDocument.<anonymous> (https://localhost:7283/SignUp:99:28)
at j (https://localhost:7283/assets/js/jquery-3.1.1.min.js:2:29948)
at k (https://localhost:7283/assets/js/jquery-3.1.1.min.js:2:30262) undefined

Uncaught TypeError: $(...).intlTelInput is not a function
at HTMLDocument.<anonymous> (SignUp:99:28)
at j (jquery-3.1.1.min.js:2:29948)
at k (jquery-3.1.1.min.js:2:30262)


Solution 1:[1]

This issue happens due to the charset of the script file to fix it you can use the below code when calling the script file.

<script src="intlTelInput.min.js" charset="utf-8"></script>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Basil