Could not find a declaration file for module ‘vuex’. vue3 + ts + vuex
Could not find a declaration file for module 'vuex'. 'd:/work/code/test/v3ts/node_modules/vuex/dist/vuex.mjs' implicitly has an 'any' type.
There are types at 'd:/work/code/test/v3ts/node_modules/vuex/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vuex' library may need to update its package.json or typings.
解决方法
在tsconfig.json下的compilerOptions下添加
"noImplicitAny": false,
"allowJs": true,
原理不知道,只知道照猫画虎,有知道的同学可以告诉我吗?
参考文章解决Could not find a declaration file for module 'vue-xxx’问题