core: TypeError: Cannot read properties of null (reading '0') in product mode
Vue version
3.4.24
Link to minimal reproduction
none
Steps to reproduce
I use a wrapper component for router-view and everything is ok in dev mode, but got error after build and deploy to product server:
index-D_lnheNN.js:14 TypeError: Cannot read properties of null (reading ‘0’)
function Ga(e) {
if (!Eo(e))
return e;
const {shapeFlag: t, children: l} = e;
if (t & 16)
return l[0];
if (t & 32 && He(l.default))
return l.default()
<router-view v-slot="{ Component, route }">
<transition name="fade" mode="out-in">
<KeepAlive :include="include">
<component :is="wrap(route.fullPath, Component)" :key="route.fullPath" />
</KeepAlive>
</transition>
</router-view>
and it’s fine after I downgrade to 3…4.23
What is expected?
no error in both dev and product mode
What is actually happening?
TypeError: Cannot read properties of null (reading ‘0’)
System Info
No response
Any additional comments?
No response
About this issue
- Original URL
- State: closed
- Created 2 months ago
- Comments: 19 (5 by maintainers)
Commits related to this issue
- fix(runtime-core): properly get keepAlive child (#10772) close #10771 — committed to vuejs/core by edison1105 2 months ago
这是 3.4.24这个版本的bug,导致只在生产环境出问题。修改使用的vue到历史版本,重新构建项目可以避免这问题。
+1
@edison1105 there you go https://github.com/Disservin/vue-10771-reproduction
(click on about)
+1
+1
please stop comment the +1, it does not help solve the problem. Please provide a runnable reproduction. I think I’ve found the issue, but I still need a demo to confirm the specific scenario in which it occurs to confirm its seriousness
+1
+1 生产有问题,路由跳转的时候报错