nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.32k stars 840 forks source link

Could not find a declaration file for module 'v-calendar'. #1341

Open jcrasgado opened 1 year ago

jcrasgado commented 1 year ago

I am using v-calendar v3.0.3 , but when import it into main.ts, it gives me the following error.

Could not find a declaration file for module 'v-calendar'. '.../node_modules/.pnpm/v-calendar@3.0.3_@popperjs+core@2.11.8_vue@3.3.4/node_modules/v-calendar/dist/es/index.js' implicitly has an 'any' type.
  There are types at '.../node_modules/v-calendar/dist/types/src/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'v-calendar' library may need to update its package.json or typings.ts(7016)

I already tried adding the type but it doesn't exist.

I am using:

Vue 3.3.4 Vite 4.3.9 TS 5.1.3

samk-dev commented 1 year ago

@jcrasgado I had the same issue making a module for Nuxt. I was able to get around it by switching to npm and install @types/lodash and in my package.json added overrides

"overrides": {
    "vue": "latest"
  }

I think if you're using Vue with Vite you don't need to set anything in package.json didn't try it.

Hope that helps