intl-tel-input icon indicating copy to clipboard operation
intl-tel-input copied to clipboard

Vue import trouble: cannot find module or its corresponding type declarations

Open seasonedtofu opened this issue 1 year ago • 1 comments

image

Hi, I am having trouble trying to import the Vue component and am not sure if I am doing it correctly.

I am getting a Cannot find module 'intl-tel-input/vue' or its corresponding type declarations. error. I have also tried importing just like from the demo/readme with import IntlTelInput from 'intl-tel-input/vueWithUtils'; and same issue.

The version I am on is 24.6.0

Is there any way to fix this? Here is my tsconfig.json below:

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"],
    },
    "lib": [
      "ESNext",
      "dom",
      "dom.iterable",
      "scripthost"
    ],
  },
  "references": [
    {
      "path": "./tsconfig.node.json"
    }
  ],
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue"
  ],
  "exclude": [
    "node_modules",
    "packages/**/dist/**"
  ]
}

seasonedtofu avatar Oct 09 '24 16:10 seasonedtofu

Unfortunately, the vue component doesn't have types yet: https://github.com/jackocnr/intl-tel-input/issues/1794

As I say in that thread, the Vue Component is actually very simple - it should be easy to add them. I don't have time to implement this myself, but would welcome a pull request.

jackocnr avatar Oct 09 '24 17:10 jackocnr