Skip to content

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

Closed
@coader

Description

@coader

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔥 p5-urgentPriority 5: this fixes build-breaking bugs that affect most users and should be released ASAP.regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions