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

Cannot read properties of null (reading 'insertBefore') #13766

Closed
baixiaoyu2997 opened this issue Apr 20, 2022 · 7 comments
Closed

Cannot read properties of null (reading 'insertBefore') #13766

baixiaoyu2997 opened this issue Apr 20, 2022 · 7 comments

Comments

@baixiaoyu2997
Copy link
Contributor

baixiaoyu2997 commented Apr 20, 2022

Environment

Nuxt project info: 19:20:02


  • Operating System: Darwin
  • Node Version: v16.14.0
  • Nuxt Version: 3.0.0-27500344.7fb29b3
  • Package Manager: yarn@1.22.18
  • Builder: vite
  • User Config: target, alias, plugins, vite
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-hfqdfg?file=app.vue

Describe the bug

see console in https://nuxt-starter-hfqdfg--3000.local.webcontainer.io/ ,will display Cannot read properties of null (reading 'insertBefore')

not sure this is nuxt bug, i have also found in vue3

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

not sure this is nuxt bug, i have also found in vuejs/core#5657

Would you try to recreate in https://stackblitz.com/github/nuxt-contrib/vue3-ssr-starter/tree/main first then?

@tiborpino
Copy link

Do you have one root element?

@danielroe
Copy link
Member

Here's an example without Nuxt: https://stackblitz.com/edit/github-tudhv3 - same issue.

I think it's an issue with the el-popover element, as when I swap it out (see https://stackblitz.com/edit/github-tudhv3-ghjbrs), everything works fine again.

I'd suggest raising it on element-plus instead.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2022
@baixiaoyu2997
Copy link
Contributor Author

thanks!

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
@danekslama
Copy link

danekslama commented Mar 20, 2024

@danielroe we experienced similar issue with element-plus as well - to be specific with the el-dialog component. The reproduction you made starts working as soon as you remove the parent element of those two spans. I tried to figure out the cause but I have no clue why it starts working as soon as you do this.

Working example:

 <div>
    <span v-if="address"></span>
    <span v-else>Nothing here</span>
  </div>

Not working with div or any other grandparent

  <div>
      <div>
        <span v-if="address"></span>
        <span v-else>Nothing here</span>
      </div>
    </div>

@danielroe
Copy link
Member

@danekslama That sounds like a vue (or element-plus) bug. See if you can reproduce on https://stackblitz.com/github/nuxt-contrib/vue3-ssr-starter.

@danekslama
Copy link

@danielroe after Vue update to 3.4.15 it started working. Unfortunately it still doesn't work on production - same issue in some cases. It is kinda difficult to reproduce now, I will try to discuss the issue elsewhere but it seems that it has been reported many times on element-plus. Hopefully, someone solves it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants