-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Hot reload fails when using Import wrappers #96
Comments
One additional info is that this issue happens only with v2 |
I looked more into this issue and it seems related to the way the HoC render function ( vue-lazy-hydration/src/utils/hydration-blocker.js Lines 84 to 89 in fc76681
I could reproduce the same problem by creating a minimal HoC that just wraps a component and forward all props. During hot-reload the component being wrapped loses all its props. function WithLogger(Component) {
return {
render(h) {
console.log('render', Component.name)
return h(Component, {
attrs: this.$attrs,
});
},
};
} Check this sandbox: https://codesandbox.io/s/vue-hot-reload-issue-with-hoc-2q1u6?file=/pages/index.vue However, passing a copy of h(Component, {
attrs: Object.assing({}, this.$attrs)
}) I tested this fix in |
Hi @paulnta what error message did you get when this happened? I think I'm having the same issue. Will try your possible fix. Regards |
@regenrek the error happen because the component props are lost sometimes after hot reload. So you may have an error like And this error triggered the next one Yes please, tell me if you have the same problem and if the fix works. |
In the current version we are using While waiting for a fix, I'll probably switch to @maoberlehner I know you are busy (based on your GH status 😄 ), but it would be amazing if you could have a look at the PR. |
I have a Nuxt project and I'm trying to understand why import wrappers such as
hydrateWhenVisible
don't work well with hot reload. When I edit a lazy hydrated component, some errors are triggered and the component seems to lose its props.Steps to reproduce:
You can use this codesandbox: https://codesandbox.io/s/vue-lazy-hydration-hot-reload-issue-vfrpm
pages/index.vue
HelloWorld.vue
will trigger the following errors (you may have to edit the template a few times before it fails)pages/index.vue
components/HelloWorld.vue
Thanks in advance 🙏
The text was updated successfully, but these errors were encountered: