GitHub发布uni-app报错 [plugin:commonjs--resolver] Package subpath './dist/vuex.esm-bundler.js' is not defined by "exports" in node_modules/vuex/package.json
发布环境
nodejs20.x
uni-app
vue3
错误描述
[plugin:commonjs--resolver] Package subpath './dist/vuex.esm-bundler.js' is not defined by "exports" in /home/runner/work/.........code/client/projects/wechat/node_modules/vuex/package.json
解决方案
这个问题在网上搜索到答案了,这个是应该vue的bug,有一个解决方案,参考:https://github.com/vuejs/vuex/issues/2178, 或者直接看vuex的解决方案https://github.com/vuejs/vuex/commit/397e9fba45c8b4ec0c4a33d2578e34829bd348d7,但是这个package.js是npm i 以后生成的,我的方案是:提前在本地npm得到一个package.js然后修改下,等Github npm i以后将本地正确的copy过去。