Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新依赖项 vue 到 2.7 后 Vue runtime 出现 read $stable from undefined 的 Error #36

Open
Kele-Bingtang opened this issue Jul 28, 2022 · 6 comments

Comments

@Kele-Bingtang
Copy link

[Vue warn]: Error in nextTick: "TypeError: Cannot read properties of undefined (reading '$stable')"

@SigureMo SigureMo changed the title 1.9.5 版本 Vupress 编译报错 1.9.5 版本 VuePress 编译报错 Jul 28, 2022
@SigureMo
Copy link
Member

SigureMo commented Jul 28, 2022

编译报错?

[Vue warn]: Error in nextTick: "TypeError: Cannot read properties of undefined (reading '$stable')"

这是 Runtime warning 吧,有什么具体的表现吗,是无法 build 还是 build 后插件无法使用?一个 warning 并不能说明你的问题……

@Kele-Bingtang
Copy link
Author

Kele-Bingtang commented Jul 28, 2022

我是用 Vdoing 主题,meting 插件用了挺久都没啥事,然后最近出现了一件奇怪的事,我的博客是分别部署在 Vercel、GitHub Pages、Gitee Pages 和我的服务器上,然后部署 同一份打包代码 时,在 Vercel 是报这个 $stable 错,其他网站不报错,依然正常运行。

编译的话是不会报错,因为当时 meting 版本是 0.3.1,也就是说 0.3.1 版本 编译 不报错,部署 在 GitHub Pages、Gitee Pages 不报错,而部署在 Vercel 报错。

然后我刚刚更新 meting 为 0.3.2 版本,然后编译后来到网页控制台就报这个错,包括打包后的代码也报错了。

您可以看看 https://notes-blog-7uauaz082-kele-bingtang.vercel.app/,这个是 0.3.1 版且能正常访问的。
然而 https://notes-blog-bqyg0srem-kele-bingtang.vercel.app/ 是更新了一些文档上去,然后就开始报错了(仅仅更新 md 文档)。
然后我调试、定位到是 meting 插件的问题,最后我注释掉了 meting 插件,然后就能正常访问了,可以看目前我最新部署的 https://notes.youngkbt.cn/

@SigureMo
Copy link
Member

SigureMo commented Jul 28, 2022

与 vuepress-plugin-meting 版本无关,我在开发环境下始终保持其为 0.3.2 版本,且未更新项目的依赖项之前一切正常,通过 pnpm up --latest 更新部分依赖项后可稳定复现该问题,更新的依赖项主要是 [email protected] -> [email protected],而且回退依赖项后一切正常

这应该是 [email protected] 中的 bug 或者可能是 vue-aplayer 中操作与 [email protected] 不兼容导致的,因此不太好从根本上解决,建议先确保通过 lockfile 来锁定版本吧,特别是 vue,先不要升 2.7 了(反正写个博客也用不上 setup 什么的新特性)

关于你只有 Vercel 报错的问题,可能是 Vercel 安装依赖时没有根据 lockfile 来安装?

@SigureMo SigureMo changed the title 1.9.5 版本 VuePress 编译报错 更新依赖项 vue 到 2.7.8 后 Vue runtime 出现 read $stable from undefined 的 Error Jul 28, 2022
@SigureMo SigureMo changed the title 更新依赖项 vue 到 2.7.8 后 Vue runtime 出现 read $stable from undefined 的 Error 更新依赖项 vue 到 2.7 后 Vue runtime 出现 read $stable from undefined 的 Error Sep 17, 2022
@wencwcoder
Copy link

wencwcoder commented Mar 23, 2023

请问一下需要修改哪些地方来锁定 vue 版本,使用的是 npm

@SigureMo
Copy link
Member

请问一下需要修改哪些地方来锁定 vue 版本,使用的是 npm

emmm,我并不清楚 npm 是否有相关参数,#40 (comment) 有写 yarn 和 pnpm 的解决方案,如果一定要用 npm 的话自行搜索一下吧

@RogueOne715
Copy link

我根据你的要求把vue版本降到了2.6.14,但是一打开控制台又报新的错误
[Vue warn]: Failed to resolve async component: () => Promise.all(/*! import() /[webpack_require.e(0), webpack_require.e(1), webpack_require.e(3), webpack_require.e(4)]).then(webpack_require.bind(null, /! ./node_modules/vuepress-theme-reco/layouts/Layout.vue */ "./node_modules/vuepress-theme-reco/layouts/Layout.vue"))
Reason: TypeError: Object(...) is not a function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants