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(kit): inspect error with top-level Proxy value #701

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

FoundTheWOUT
Copy link
Contributor

The getSetupStateType will try to access the Proxy by some flag to judge whether the Proxy is a reactivity or not. If the getter fail, for example, the getter do function call, then the inspection would down.
By wrapping getSetupStateType in try...catch block could avoid this situation, but will still get the wrong value.
If we have a way to display the Proxy in the StateViewer properly would be impressive.

Copy link

netlify bot commented Nov 16, 2024

Deploy Preview for vue-devtools-docs ready!

Name Link
🔨 Latest commit c0fcb52
🔍 Latest deploy log https://app.netlify.com/sites/vue-devtools-docs/deploys/6745b741cb8a5b000906e218
😎 Deploy Preview https://deploy-preview-701--vue-devtools-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@FoundTheWOUT
Copy link
Contributor Author

FoundTheWOUT commented Nov 22, 2024

cc @webfansplz,would you please review this. thanks

@alexzhang1030
Copy link
Member

alexzhang1030 commented Nov 26, 2024

LGTM, due to this being an edge case, adding extra logic might add some performance overhead. Just showing an error in StateViewer is expected.

image

Copy link

pkg-pr-new bot commented Nov 26, 2024

Open in Stackblitz

@vue/devtools-applet

npm i https://pkg.pr.new/@vue/devtools-applet@701

@vue/devtools-core

npm i https://pkg.pr.new/@vue/devtools-core@701

@vue/devtools

npm i https://pkg.pr.new/@vue/devtools@701

@vue/devtools-api

npm i https://pkg.pr.new/@vue/devtools-api@701

@vue/devtools-kit

npm i https://pkg.pr.new/@vue/devtools-kit@701

vite-plugin-vue-devtools

npm i https://pkg.pr.new/vite-plugin-vue-devtools@701

commit: c0fcb52

@webfansplz webfansplz changed the title fix(kit): top level Proxy value inspect error cause inspection fail fix(kit): inspect error with top-level Proxy value Nov 27, 2024
@webfansplz webfansplz merged commit 4539ee9 into vuejs:main Nov 27, 2024
7 checks passed
@dragomirweb
Copy link

Why does the the top level proxy contain a foo function? @webfansplz

@alexzhang1030
Copy link
Member

Why does the the top level proxy contain a foo function? @webfansplz

image

User defined

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

Successfully merging this pull request may close these issues.

4 participants