Validator.js: Issue on macOS/iOS after latest update:

Created on 14 Jun 2020  路  4Comments  路  Source: validatorjs/validator.js

Describe the bug
After the pull request merge 3 days ago, the validator package breaks the site on iOS devices. I am just importing the validator package in a Vue CLI 3 built project.

import validator from 'validator'

The app works fine on Windows, Linux, and Android, but breaks on macOS devices. It throws the following error:

[Error] SyntaxError: Invalid regular expression: invalid group specifier name eval (chunk-vendors.js:5232) ./node_modules/validator/lib/isMobilePhone.js (chunk-vendors.js:5232) _webpack_require_ (app.js:85) Eval Code eval ./node_modules/validator/index.js (chunk-vendors.js:4524) _webpack_require_ (app.js:85) Eval Code eval ./src/mixins/validation.js (app.js:728) _webpack_require_ (app.js:85) Eval Code eval ./src/main.js (app.js:692) _webpack_require_ (app.js:85) Eval Code eval (anonymous function) (app.js:811) _webpack_require_ (app.js:85) checkDeferredModules (app.js:46) (anonymous function) (app.js:222) Global Code (app.js:223)

It seems like one of the exports isMobilePhone.js is using look behind in one of the regular expressions (I guess look behinds are nor supported in iOS), which stops the code from doing anything and breaks the site upon entering it.

It works on
Windows, Android, Linux, Chrome and, macOS
It doesn't work on
Safari on macOS and any browser on iOS

Examples
Here's a screenshot of the console:
WhatsApp Image 2020-06-14 at 11 20 05 PM

Additional context
Validator.js version: 13.1.1
OS platform: [macOS]

馃悰 bug 馃攳needs-investigation

Most helpful comment

I found too this problem on 13.1.0. Updating to 13.1.1 resolves it.

All 4 comments

Please confirm that this is 13.1.1, this was fixed, the issue was on 13.1.0

@profnandaa and @nadirabbas I will try to do an investigation on this issue.

I found too this problem on 13.1.0. Updating to 13.1.1 resolves it.

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Maxreglez picture Maxreglez  路  3Comments

IOAyman picture IOAyman  路  4Comments

AnandChowdhary picture AnandChowdhary  路  3Comments

MindRapist picture MindRapist  路  4Comments

rathboma picture rathboma  路  4Comments