Leszek Mazur
Leszek Mazur

Reputation: 2531

Could not find a declaration file for module 'vuetify/lib/framework'

When I execute command npm run serve there is above error:

2:21 Could not find a declaration file for module 'vuetify/lib/framework'. 'C:/Users/valut/source/repos/BricksDryierClient/client-app/node_modules/vuetify/lib/framework.js' implicitly has an 'any' type.
  Try `npm install @types/vuetify` if it exists or add a new declaration (.d.ts) file containing `declare module 'vuetify/lib/framework';`       
    1 | import Vue from 'vue';
  > 2 | import Vuetify from 'vuetify/lib/framework';
      |                     ^
    3 | 
    4 | Vue.use(Vuetify);
    5 | 

I tried to add vuetify to compilerOptions.types in tsconfig.json, but it isn't help.

Upvotes: 4

Views: 6872

Answers (3)

Evans Sarpong
Evans Sarpong

Reputation: 41

Just do it this way

import Vuetify from 'vuetify/lib'; in your "main.js".

Upvotes: 0

康米Commie
康米Commie

Reputation: 13

I found my self using advanced option when choosing a vuetify preset("Configure (advanced)"), then I tried "Default (recommended)" option to recreate the project and it works.

Upvotes: 0

Leszek Mazur
Leszek Mazur

Reputation: 2531

You should change the second line in src/plugins/vuetify.ts from:

import Vuetify from 'vuetify/lib/framework';

to:

import Vuetify from 'vuetify/lib';

Upvotes: 17

Related Questions