Skip to content

fix(#2591): expose defineExpose bindings on findComponent vm - #2927

Open
adamberecz wants to merge 1 commit into
vuejs:mainfrom
adamberecz:fix/2591-findComponent-exposed-vm
Open

fix(#2591): expose defineExpose bindings on findComponent vm#2927
adamberecz wants to merge 1 commit into
vuejs:mainfrom
adamberecz:fix/2591-findComponent-exposed-vm

Conversation

@adamberecz

Copy link
Copy Markdown

Summary

  • findComponent() now returns defineExpose() / expose() bindings on vm for bundled-style components (setup that returns a render function). Vue only creates exposeProxy lazily (template ref or directive), so a child can have an exposed API while exposeProxy is still null.
  • Also wrap those instances in the vm proxy when devtoolsRawSetupState is missing, which is the typical bundled <script setup> case.
  • Adds a reproduction for Bug: findComponent doesn't not return exposed properties in vm if component is bundled #2591 plus coverage for exposeProxy === null.

This supersedes #2715.

Fixes #2591

Test plan

  • pnpm test — includes bundled-style findComponent case and null-exposeProxy cases
  • pnpm run lint / format-check / test:build / tsd / vue-tsc / tsc:docs

Made with Cursor

@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for vue-test-utils-docs ready!

Name Link
🔨 Latest commit 43ca398
🔍 Latest deploy log https://app.netlify.com/projects/vue-test-utils-docs/deploys/6a82e355a223280007ac9946
😎 Deploy Preview https://deploy-preview-2927--vue-test-utils-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 project configuration.

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.

Bug: findComponent doesn't not return exposed properties in vm if component is bundled

1 participant