Could not find a declaration file for vue-chartjs
See original GitHub issueExpected Behavior
Having run npm i vue-chartjs
and installed the peer chart.js import { Line } from 'vue-chartjs';
should enable the use of a line chart in a component.
Actual Behavior
Error Message: Could not find a declaration file for vue-chartjs.
Environment
- vue.js version: 2.5.16
- vue-chart.js version: @latest
- npm version: 6.1.10
Package.json depdendencies
"dependencies": { "@fortawesome/fontawesome": "^1.1.8", "@fortawesome/fontawesome-free-solid": "^5.0.13", "@fortawesome/vue-fontawesome": "0.0.23", "bootstrap-vue": "^2.0.0-rc.11", "chart.js": "^2.7.2", "vue": "^2.5.16", "vue-chartjs": "^3.3.2", "vue-class-component": "^6.0.0", "vue-property-decorator": "^6.0.0", "vue-router": "^3.0.1", "vuex": "^3.0.1" },
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Could not find a declaration file for module 'vue-xxx'
This error occured because of vue-xxxxxx has been generated in JavaScript. Method 1: To avoid the issue I just replace it by the...
Read more >Could not find a declaration file for module - Vue Forum
Every time I install third-party package using npm. And import it to my component. Get this error "Could not find a declaration file...
Read more >How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d.ts) file containing `declare module 'XYZ';. If XYZ is a direct...
Read more >Could not find declaration file for module 'X' Error | bobbyhadz
The error "Could not find declaration file for module" occurs when TypeScript cannot find the type declaration for a module. To solve the...
Read more >Error: Could not find a declaration file for module - YouTube
Fix error: Could not find a declaration file for module ... implicitly has an 'any' type.Try npm install library-name if it exists or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @lee-alderdice
I’ve worked on a PR to add type definitions. However I never really used typescript and also not that experienced in writing
*.d.ts
for it.Could you check it out and maybe test it in your project?
I created a new
vue create
project with TS support. And usedyarn link
to link the PR into the project.It seems to be working now. But verification would be great before merging.
Sure. Empty vue-cli project with Typescript et al. having run npm install and creating a simple Line.vue component importing Line from vue-chartjs.
https://github.com/lee-alderdice/vuechartjs.ts