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 read property '0' of undefined #31

Closed
metinjakupi opened this issue Nov 25, 2019 · 1 comment
Closed

Cannot read property '0' of undefined #31

metinjakupi opened this issue Nov 25, 2019 · 1 comment

Comments

@metinjakupi
Copy link

Hello just found this npm package and i wanted to test but unfortunately i cant use it from strange error that it comes from LazyHydrate.js:339:31

<LazyHydrate when-visible>
         <post-list v-if="posts && !isLoading" :posts="posts" title="Recent Posts"></post-list>
       </LazyHydrate>

And it gives me error Cannot read property '0' of undefined the error cames from here

render: function render(h) {
      var tag = this.$el ? this.$el.tagName : "div";
      var child = this.$scopedSlots.default ? this.$scopedSlots.default({
        hydrated: this.hydrated
      }) : this.$slots.default[0]; // This line causes error
      var vnode = this.hydrated ? child : h(tag); // Special thanks to Rahul Kadyan for the following lines of code.
      // https://github.com/znck
@taraskhvyl
Copy link

Try to change your code to:
<LazyHydrate when-visible v-if="posts && !isLoading"> <post-list :posts="posts" title="Recent Posts"></post-list> </LazyHydrate>

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

No branches or pull requests

2 participants