Open WakerCN opened 1 year ago
same issue . Has anyone fixed it yet?
@dungtv1291 you can look this issue issues/2213
it seem vuex not maintain anymore
you can manual change file package.json
in path node_modules\vuex\package.json
and add this
fixing it in the node_modules folder is not a good idea
Here is my workaround: https://github.com/vuejs/vuex/issues/2213#issuecomment-1592267216
@dungtv1291 you can look this issue issues/2213 it seem vuex not maintain anymore you can manual change file
package.json
in pathnode_modules\vuex\package.json
and add this
Although fixing it in the node_ modules folder is not a good idea, but. it does work. Many thxs
I fixed this with a d.ts file, on my src/ directory
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";
}
Note that if you're using "isolatedModules": true
then you'll want to declare like this to avoid errors about type-only exports not using export type
:
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 type * from "vuex/types/vue.d.ts";
}
你的邮件我已收到!
使用npm init vue@latest安装的vue项目, 安装vuex后 store引入vuex,ts报错
Could not find a declaration file for module 'vuex'. 'g:/dg-b-front/node_modules/vuex/dist/vuex.mjs' implicitly has an 'any' type. There are types at 'g:/dg-b-front/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.ts(7016)