-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
bug with vue3 ssr and dynamic component #2863
Comments
As a workaround you can specify the component options object instead of its name: setup() {
return {
view: MyTest,
}
}, |
thanks, it works |
This issue provides more easier reproduction. @edison1105 , thanks for your PR first, but your PR didn't fix the root cause. As I said here
ssrRender() {
// it's equivalent to calling `ssrRender` recursively
ssrRenderComponent(Comp)
// here, the `currentRenderingInstance` will be `null`
// so resolving component will fail
resolveDynamicComponent(xxx)
} what we need to do is to ensure that the And you can test #3244 with your PR, you will understand what I’m talking about. |
Hello. First of all, thank you for your work on the issue. |
@rstoenescu A workaround for your report: // Home.vue
const ComponentA = {
setup () {
return () => h('div')
}
}
const MyX = {
setup () {
return () => h('div')
}
}
export default {
setup () {
return {
myComponentName: ComponentA
}
}
} |
Thanks for the effort @chrislone @yyx990803. This issue was closed by your PR, however, the original repro still doesn't work even after updating to 3.0.11. |
Just for the record, this currently works with Vue 3.1.2 |
Version
3.0.4
Reproduction link
https://github.com/lovetingyuan/vue3-ssr-dynamic-component-bug
Steps to reproduce
see github repo readme.md: https://github.com/lovetingyuan/vue3-ssr-dynamic-component-bug#vue3-ssr-dynamic-component-bug
run
yarn build:ssr
andnode dist-ssr/_assets/server-main
As you can see, component
MyTest
is not rendered as expect.But if I remove
TopHeader
inApp.vue
, the ssr result is correct.What is expected?
each component can be resolved and rendered to html string.
What is actually happening?
One component is not be resolved and parsed correctly.
The text was updated successfully, but these errors were encountered: