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

No data on Option API component returned by mountSuspended #735

Open
kingyue737 opened this issue Jan 25, 2024 · 2 comments
Open

No data on Option API component returned by mountSuspended #735

kingyue737 opened this issue Jan 25, 2024 · 2 comments

Comments

@kingyue737
Copy link

kingyue737 commented Jan 25, 2024

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.9.3
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-ddvycp

Describe the bug

const wrapper = await mountSuspended(OptionAPIComponent)

wrapper.vm.$data is empty
wrapper.setData({...data}) will result into error:

TypeError: Cannot add property, object is not extensible

Furthermore, I cannot call any method of the component instance:

TypeError: wrapper.vm.myMethod is not a function

Additional context

Component written in composition api doesn't have this issue.
@vue/test-utils doesn't have this issue.

Logs

No response

@sei-jdshimkoski
Copy link

I see the same issue, however, my component is written with the composition API.

@georiv
Copy link

georiv commented Apr 11, 2024

I see the same issue, however, my component is written with the composition API.

Did you guys found a solution? i'm having the same issue in nuxt 3 app

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

No branches or pull requests

3 participants