element-plus [Component] [scrollbar] ElScrollbar - TypeError: Cannot read properties of null (reading 'insertBefore')

v7pvogib  于 6个月前  发布在  其他
关注(0)|答案(4)|浏览(63)

Bug Type: Component

Environment

  • Vue Version: 3.3.4
  • Element Plus Version: 2.3.8
  • Browser / OS: Chrome 114.0.5735.198 / Linux Mint 20.3 Cinnamon
  • Build Tool: Vite

Reproduction

  • el-scrollbar

Github Repo

Steps to reproduce

  1. Build in prod mode (npm run build) (PROD mode is important, because in dev mode works fine)
  2. Open builded project
  3. Click by add button
  4. See in console. You see TypeError: Cannot read properties of null (reading 'insertBefore')

What is Expected?

Work indent (without errors)

What is actually happening?

TypeError: Cannot read properties of null (reading 'insertBefore')

Additional comments

I created environment in element-plus-playground, but this bug not reproduce, because element-plus-playground build project in dev mode.
Please, see link with github.

I see next behavior, in TestComp.vue we have

<template v-if="visibleTitle" #title>
  <h1>My title</h1>
</template>

If you change this to:

<template #title>
  <h1 v-if="visibleTitle">My title</h1>
</template>

Or you comment <el-scrollbar> in TestItems.vue

Everything will work. This is strange.

xzv2uavs

xzv2uavs2#

And vue core issue , but I can't reproduce in vue without element-plus

nc1teljy

nc1teljy3#

我也遇到了类似问题, 页面在dialog关闭后 会报错 Cannot read properties of null (reading 'insertBefore') element 2.3.9版本
vue 3.2.30

fquxozlt

fquxozlt4#

所以有什么下文不,

相关问题