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

parsePhoneNumberFromString.isValid() as vue computed prop throws an error

4l1c30zz opened this issue · comments

commented

Hello, I recently updated the library and started to get new error)
If I'm calling it outside of the component without any dynamic input the error is not exists.

Steps to reproduce

I reproduced the behavior in code pen :
https://codepen.io/f1na3/pen/rNzvrGZ

Observed result

On input I'm getting TypeError: (intermediate value)(...) is undefined
It is working fine with isValidPhoneNumber()

Expected result

I'm expecting that parsePhoneNumberFromString(this.phoneNumber,"IL").isValid() will work similar as isValidPhoneNumber(this.phoneNumber,"IL") (as it was before)

Google's demo link

Unfortunately This one is less relevant for my case

Hello

Hi

If I'm calling it outside of the component without any dynamic input the error is not exists.

This means that the code you're running has a bug somewhere.

Perhaps your code doesn't check for parsePhoneNumberFromString(this.phoneNumber,"IL") being undefined or something.

I'm closing it because no minimal example has been provided and the demo is too convoluted to look at.