devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Standalone devtools not working when app is mounted to body + top-level await

Open ferferga opened this issue 10 months ago • 1 comments

My app is mounted to document.body directly, which in itself does not cause an issue with DevTools. However, I also use top-level await, which delays the mounting process until all the promises have been resolved. This order of events cause a race condition, where DevTools is mounted before the app and it get's replaced by Vue after mounting

Expected behaviour

Devtools should be mounted after it detects that all the other apps are also mounted to avoid being overwritten (we can't stop the user from manipulating the DOM, so I think it's a sensible middleground).

Reproduction

https://stackblitz.com/edit/vue3-vite-typescript-starter-jkegp2zi?file=src%2Fmain.ts

ferferga avatar Dec 19 '24 16:12 ferferga