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

我与影子孤独终老i 提交于 2021-02-08 06:43:53

问题


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.


回答1:


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

import Vuetify from 'vuetify/lib/framework';

to:

import Vuetify from 'vuetify/lib';


来源:https://stackoverflow.com/questions/65172139/could-not-find-a-declaration-file-for-module-vuetify-lib-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!