FranckFreiburger / vue-pdf

vue.js pdf viewer
MIT License
2.22k stars 522 forks source link

Cannot find module 'vue-pdf' or its corresponding type declarations. #277

Open EdisonVan opened 3 years ago

EdisonVan commented 3 years ago

"vue-pdf": "^4.2.0", "vue": "^3.0.0", chorme version 87.0.4280.88 iPhone OS 13_2_3 image

piscis commented 3 years ago

vue-pdf has no type definitions have a look at this ticket for a workaround:

https://github.com/FranckFreiburger/vue-pdf/issues/255

Basically creating a shim in your src directory like

declare module 'vue-pdf' {
  export default pdf;
}

and save it as shims-vue-pdf.d.ts . After you restart VSCode or reindex typescript + vetur via command prompt it should stop warning you, ... at least this is what it did in my case. BUT type definitions would be nice to ;-) wink (tested with typescript 3.9.1)