vue-demi
vue-demi copied to clipboard
vue-demi latest version bug with yarn
I have a project that uses my plugin v-code-diff and @vueuse/core, the project uses the yarn package manager. v-code-diff uses vue-demi: latest version. And the order of v-code-diff is after @vueuse/core in dependencies of package.json, like this.
"dependencies": {
"@vueuse/core": "^8.9.3",
"v-code-diff": "^0.3.11",
"vue": "^2.7.7"
}
When yarn.lock does not exist, execute yarn to install dependencies, start the project, and the project can work normally.

Then delete node_modules but not deleting yarn.lock. When reinstalling dependencies with yarn, the project cannot work normally

I compared the node_modules and yarn.lock of the two versions before and after. yarn.lock is the same before and after, but node_modules has changed as shown below
(node_modules2 can work, node_modules cannot work)

I suspect it has something to do with the different versions of vue-demi in the two plugins. I uploaded the test package shimada666-test, the code is the same as v-code-diff, but the version of vue-demi is adjusted to ^0.13.6, the problem seems to be solved.
Also, if the order of v-code-diff is adjusted before @vueuse/core , it seems to be fine.
Also, if I use pnpm package management, it seems to be fine.
The minimal reproducible repository: https://github.com/Shimada666/vue27_vuedemi
为了怕描述不清楚,我用中文重复一遍
我有一个项目,使用了我的插件 v-code-diff 和 @vueuse/core,项目使用 yarn 包管理器。其中 v-code-diff 使用了 vue-demi: latest。且在 package.json 的 dependencies 中,v-code-diff 在 @vueuse/core 之后,像这样。
"dependencies": {
"@vueuse/core": "^8.9.3",
"v-code-diff": "^0.3.11",
"vue": "^2.7.7"
}
当不存在 yarn.lock 时,执行 yarn 安装依赖,启动项目,项目是能够正常运行的。

此时删除 node_modules 但不删除 yarn.lock,重新 yarn 安装依赖时,项目无法正常运行

我对比了前后两个版本的 node_modules 和 yarn.lock。前后 yarn.lock 是相同的,但 node_modules 产生了变化 (node_modules2 是正常的,node_modules 是有问题的)
我怀疑和两个插件中 vue-demi 的版本不同有关。我搞了个测试包 shimada666-test,代码与 v-code-diff 相同,但 vue-demi 的版本调整为了 ^0.13.6,问题似乎得到了解决。
另外,如果把 v-code-diff 放在 @vueuse/core 之前,似乎也没问题。
此外,如果包管理用 pnpm,似乎也没问题。
最小可复现的仓库:https://github.com/Shimada666/vue27_vuedemi
And I don't have this problem when I use vue2.6 and vue-composition-api