vue-cal icon indicating copy to clipboard operation
vue-cal copied to clipboard

Failed to resolve module specifier "vue-cal"

Open szekelygobe opened this issue 2 years ago • 1 comments

After install npm i vue-cal and in my js file: import VueCal from 'vue-cal' import 'vue-cal/dist/vuecal.css' failed to import with this error message: Failed to resolve module specifier "vue-cal"

szekelygobe avatar Oct 17 '22 05:10 szekelygobe

If you are using Vue-cal in Vue + Typescript project, then you can't using module. Because author not add type defenitions to source code (*.d.ts files). You have 2 methods:

  1. Easy method: Add 2 lines to tsconfig.json file in your project folder. This switch off type checking in imported JS modules. { "compilerOptions": { ... "noImplicitAny": false, "allowJs": true, ... } }
  2. Advanced method. Write .d.ts file yourself to complete type checking. Info https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html

Today I also met with the same problem. Solved using first method. I hope the author will add the necessary files to the project to support Typescript. I'm busy at the moment, but as soon as I'm free I can help the author with Typescript

snurbol avatar Oct 17 '22 09:10 snurbol

@snurbol #168 there is .d.ts file for vue2, it might help you

cubxx avatar May 25 '24 17:05 cubxx