已知在旧版包括 5.23 alpha 都一直正常。升到 5.24 稳定版后,运行到web和App下,在应用启动时直接异常失败
WEB端报错:
main.ts:19 TypeError: Cannot assign to read only property '_' of object '#<Object>'
at assign (<anonymous>)
at updateSlots (vue.runtime.esm.js:5820:9)
at updateComponentPreRender (vue.runtime.esm.js:7487:5)
at ReactiveEffect.componentUpdateFn [as fn] (vue.runtime.esm.js:7402:11)
at ReactiveEffect.run (vue.runtime.esm.js:153:19)
at instance.update (vue.runtime.esm.js:7469:17)
at updateComponent (vue.runtime.esm.js:7277:18)
at processComponent (vue.runtime.esm.js:7211:7)
at patch (vue.runtime.esm.js:6666:11)
at patchKeyedChildren (vue.runtime.esm.js:7622:9)
logError @ vue.runtime.esm.js:1443
handleError @ vue.runtime.esm.js:1430
callWithErrorHandling @ vue.runtime.esm.js:1383
flushJobs @ vue.runtime.esm.js:1585
Promise.then
queueFlush @ vue.runtime.esm.js:1494
queueJob @ vue.runtime.esm.js:1488
scheduler @ vue.runtime.esm.js:3179
resetScheduling @ vue.runtime.esm.js:236
triggerEffects @ vue.runtime.esm.js:280
triggerRefValue @ vue.runtime.esm.js:1033
set value @ vue.runtime.esm.js:1078
finalizeNavigation @ vue-router.mjs?v=e0f8e456:2474
(anonymous) @ vue-router.mjs?v=e0f8e456:2384
Promise.then
pushWithRedirect @ vue-router.mjs?v=e0f8e456:2352
push @ vue-router.mjs?v=e0f8e456:2278
install @ vue-router.mjs?v=e0f8e456:2631
use @ vue.runtime.esm.js:5146
initRouter @ uni-h5.es.js:16505
install @ uni-h5.es.js:16574
use @ vue.runtime.esm.js:5146
(anonymous) @ main.ts:19
App端报错:
reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught SyntaxError: Unexpected token '='
试过社区内多年前帖子的相关解决方法都无效,目前暂退回 5.23 保命
1 个回复
Ask小助手 - Ask社区AI助手
好的,收到你的 bug 反馈。作为 DCloud 官方人员,我对这个反馈进行如下评审和分析:
1. 反馈质量评审
这个 bug 反馈的整体质量较高,关键信息提供得比较清晰,但存在一些影响复现的缺失。
main.ts的内容,但其中引入了uview-pro、httpPlugin以及自定义的httpInterceptor和httpRequestConfig。这些第三方库和自定义配置往往是导致编译或运行异常的直接原因。建议补充这些相关依赖的代码或提供一个最简可复现的完整工程。评审结论:反馈有效,但若能提供一个包含相关依赖的最简复现工程,将极大提升问题处理的优先级和效率。
2. 问题分析与排查
根据反馈内容,在知识库中暂未找到与 5.24 版本完全匹配的已知 Issue 记录。但从报错信息来看,可以推断出以下方向:
TypeError: Cannot assign to read only property '_' of object '#<Object>'发生在 Vue 的updateSlots和updateComponentPreRender阶段。这通常是因为在 Vue3 的响应式系统中,尝试修改了一个被冻结或只读的对象属性。结合main.ts中的代码,极有可能是uview-pro或其httpPlugin在处理插槽或内部状态时与 Vue3 的响应式机制产生了冲突,或者该库尚未完全兼容当前使用的 Vue3 版本。Uncaught SyntaxError: Unexpected token '='通常意味着编译后的 JS 代码存在语法错误。这可能是由于第三方库(如uview-pro)在编译阶段被错误处理,或者其内部代码使用了当前编译器不支持的语法。排查建议:
main.ts中暂时注释掉app.use(uViewPro).use(httpPlugin, {...})相关代码,观察应用是否能正常启动。如果正常,则说明问题出在uview-pro插件上。uview-pro是否声明兼容 Vue3,并检查package.json中vue和uview-pro的版本,尝试更新到最新版本。如果以上步骤均无法解决,这很可能是一个由特定项目结构或第三方库触发的升级兼容性 Bug。请将你的项目(可脱敏处理后)通过 issues 系统或私聊提供给官方人员,我们会进行深入排查。
要回复问题请先登录或注册
公告
更多>相关问题