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

Cannot have v-if and Async component together #3560

Closed
stardustxx opened this issue Apr 7, 2021 · 0 comments · Fixed by #3563
Closed

Cannot have v-if and Async component together #3560

stardustxx opened this issue Apr 7, 2021 · 0 comments · Fixed by #3563
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working

Comments

@stardustxx
Copy link

Version

3.0.11

Reproduction link

https://github.com/stardustxx/vite-ssr-issue

Steps to reproduce

yarn && yarn dev to see it in your browser
You may see text like App and Async component but will see error in the console

Particularly the following code in App.vue

<template>
  <h1 v-if="mounted">App</h1>

  <Async />
</template>

Async is a component defined by defineAsyncComponent
If you move the h1 to be below Async, h1 will not be rendered due to the error. Removing the h1 or the v-if condition solves the problem

What is expected?

No warning or errors reported and components are rendered correctly

What is actually happening?

Encountered error like the following and stops the rendering

Uncaught (in promise) TypeError: Cannot read property 'emitsOptions' of null
    at shouldUpdateComponent (runtime-core.esm-bundler.js:1041)
    at updateComponent (runtime-core.esm-bundler.js:4230)

Please let me know if it's a vite issue then I can post it there, thank you

@HcySunYang HcySunYang added 🐞 bug Something isn't working ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Apr 8, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants