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

TypeError: Cannot read properties of null (reading '0') in product mode #10771

Closed
coader opened this issue Apr 23, 2024 · 19 comments · Fixed by #10772
Closed

TypeError: Cannot read properties of null (reading '0') in product mode #10771

coader opened this issue Apr 23, 2024 · 19 comments · Fixed by #10772
Labels
🔥 p5-urgent Priority 5: this fixes build-breaking bugs that affect most users and should be released ASAP. regression

Comments

@coader
Copy link

coader commented Apr 23, 2024

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

@edison1105
Copy link
Member

edison1105 commented Apr 23, 2024

Please provide a minimal reproduction.

Edit
related commit e51ca61
image

@edison1105 edison1105 added the need more info Further information is requested label Apr 23, 2024
@JackieCheung
Copy link

+1

@Mophar-gift
Copy link

+1

本地环境没问题,线上环境会出现这个问题

@edison1105 edison1105 added ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. regression and removed need more info Further information is requested labels Apr 23, 2024
@co2color
Copy link

+1
image

@edison1105
Copy link
Member

edison1105 commented Apr 23, 2024

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

@fwd001
Copy link

fwd001 commented Apr 23, 2024

+1 生产有问题
image

@edison1105 edison1105 added 🔥 p5-urgent Priority 5: this fixes build-breaking bugs that affect most users and should be released ASAP. and removed ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Apr 23, 2024
@rex-ll
Copy link

rex-ll commented Apr 24, 2024

+1

@LebronLei
Copy link

+1 生产有问题,路由跳转的时候报错

@sodatea
Copy link
Member

sodatea commented Apr 24, 2024

请提供可以运行的复现代码。

@lau96
Copy link

lau96 commented Apr 24, 2024

+1

@Disservin
Copy link
Contributor

Disservin commented Apr 24, 2024

@edison1105 there you go https://github.com/Disservin/vue-10771-reproduction

(click on about)

@JamesY-Jey

This comment was marked as duplicate.

@mote-ice
Copy link

+1

@edison1105
Copy link
Member

@Disservin Thanks.
I've reproduced the problem
image

related commit e51ca61

@LebronLei
Copy link

这是 3.4.24这个版本的bug,导致只在生产环境出问题。修改使用的vue到历史版本,重新构建项目可以避免这问题。

@wzsgtom
Copy link

wzsgtom commented Apr 24, 2024

hhh真巧了,一天之内正好撞上这个issue的出现和修复

@lianyitj
Copy link

我查了两天程序,一直到现在才知道这里的问题,宝贵的时间啊!。。。郁闷。。。。

@fov9991
Copy link

fov9991 commented Apr 25, 2024

+1

@shuTwT
Copy link

shuTwT commented Apr 25, 2024

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔥 p5-urgent Priority 5: this fixes build-breaking bugs that affect most users and should be released ASAP. regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.