vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Home Page:https://vuejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asynchronous processing of setup function fails

devAiri opened this issue · comments

Version

3.2.26

Reproduction link

sfc.vuejs.org/

Steps to reproduce

  • Make the setup function asynchronous(async setup())
  • Call asynchronous processing in setup function(await new Promise())
    →Error message is displayed「Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode')」

What is expected?

I want the setup function to be able to be normally asynchronous

What is actually happening?

Maybe you haven't received the Promise well with the life cycle hook.
The experimental feature suspense cannot be used either.


It looks like a similar issue has been resolved before, but the bug hasn't been fixed.

#3857

Components with async setup have to be nested in a Suspense component.

commented

The problem is reproduced in the same way inside Suspense

I disagree. Feel free to provide a reproduction in a new issue though.