CdTgr / vue3-q-tel-input

Vue 3 telephone input implemented over Quasar framework
MIT License
12 stars 14 forks source link

Use of eval is strongly discouraged as it poses security risks #24

Closed andyslack closed 1 year ago

andyslack commented 1 year ago

Hi all,

The component is currently throwing up this error:

ERROR Use of eval in "node_modules/vue3-q-tel-input/dist/vue3-q-tel-input.esm.js" is strongly discouraged as it poses security risks and may cause issues with minification.

Implementation is:

import Vue3QTelInput from 'vue3-q-tel-input'
import 'vue3-q-tel-input/dist/vue3-q-tel-input.esm.css'

Any suggestions?

CdTgr commented 1 year ago

@andyslack The actual error comes from the google-libphonenumber. If you could suggest any other libraries to do the phone number validation, I can switch to that.

CdTgr commented 1 year ago

Here is a screenshot for reference.

image
andyslack commented 1 year ago

I submitted a ticket on their repo - https://github.com/ruimarinho/google-libphonenumber/issues/361

Hopefully someone can take a look, I'm not great with tsc build/rollup, so not sure where to start on this, but if you have some free time and think you can fix it, feel free to submit a PR on their project.

ruimarinho commented 1 year ago

Hi,

I don't know if this part of code is actually evaluated for the purpose you're going to use it for (please double check this), but this comes directly from Google Closure Library, which is a direct dependency of libphonenumber. I don't think there's anything I can do to change this on my side. See similar concerns at https://github.com/google/libphonenumber/pull/2605#issuecomment-870905467.

CdTgr commented 1 year ago

@ruimarinho There is an alternative library (libphonenumber-js)[https://www.npmjs.com/package/libphonenumber-js] for the number formatting. I will change the code to use this library and so the issue would be solved.

CdTgr commented 1 year ago

the issue is resolved in v1.1.0