solved Could not find a declaration file for module 'vuex'.

Recently I was rewriting the email client using Vue and encountered an error when using Vuex to process data.

Could not find a declaration file for module 'vuex'.

Vuex does not have @types/vuex, so it can only be solved by adding d.ts manually.

Add vuex.d.ts in the project directory and add the following content:

1
2
3
4
5
6
declare module "vuex" {
export * from "vuex/types/index.d.ts";
export * from "vuex/types/helpers.d.ts";
export * from "vuex/types/logger.d.ts";
export * from "vuex/types/vue.d.ts";
}

solved Could not find a declaration file for module 'vuex'.
https://blog.justforlxz.com/2023/09/11/solved-Could-not-find-a-declaration-file-for-module-vuex/
作者
小竹
发布于
2023年9月11日
许可协议