Overview
I integrated the vue2-timepicker plugin into my Typescript/Nuxt.js application. However, I encountered an issue with importing vue2-timepicker
.
import timepicker from 'vue2-timepicker'
Could not find a declaration file for module 'vue2-timepicker'.
'/home/jpskgc/sample-nuxt/node_modules/vue2-timepicker/dist/VueTimepicker.umd.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/vue2-timepicker` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue2-timepicker';`
I am looking for a solution to this problem.
Attempted Solutions
I attempted to install @types/vue2-timepicker, but it seems that it does not exist.
❯ yarn add @types/vue2-timepicker
yarn add v1.22.17
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@types%2fvue2-timepicke: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/home/jpskgc/sample-nuxt/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Code Repository
Please refer to the following repository for the actual code.
https://github.com/jpskgc/nuxt-sample/blob/main/components/registration-form/index.vue