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

fix(devtools): allow devtools to identify parent components of hydrated elements. #7556

Closed
wants to merge 1 commit into from

Conversation

LinusBorg
Copy link
Member

See: vuejs/devtools#2004

This PR replicates the following code, which runs for devtools during mountElement(), so that it also runs during hydrateElement()

if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
Object.defineProperty(el, '__vnode', {
value: vnode,
enumerable: false
})
Object.defineProperty(el, '__vueParentComponent', {
value: parentComponent,
enumerable: false
})
}

@niksy
Copy link

niksy commented May 17, 2023

Any updates on this? What can we do to get this merged? In the meantime, for those looking for a quick fix, use https://github.com/ds300/patch-package and patch local version of Vue.

@TechAkayy
Copy link

Would be good to have this merged in please, as devtools is still having the issue. Thanks in advance!

@TechAkayy
Copy link

TechAkayy commented Oct 23, 2023

@LinusBorg, request you to kindly merge this fix, it has been pending for a long time.

This issue does confuse users when using devtools (incl the new nuxt-devtools) until they reach the relevant issue on vue-devtools repo, and here.

Thank you!

@skirtles-code
Copy link
Contributor

I'm wondering whether this is still an issue since #9328 was merged? The fixes look very similar.

@niksy
Copy link

niksy commented Apr 14, 2024

Applying these changes to latest Vue (3.4.21) results in following error:

Uncaught (in promise) TypeError: Cannot redefine property: __vnode

It seems like dev tools select works on initial load, but when your refresh the page with dev tools open and Vue tab selected, it stops working. Solution is to close dev tools and reopen.

So I guess this sort of works?

@yyx990803 yyx990803 closed this Apr 29, 2024
@yyx990803
Copy link
Member

Closing as duplicate of #9328

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

Successfully merging this pull request may close these issues.

None yet

5 participants