maoberlehner / vue-lazy-hydration

Lazy Hydration of Server-Side Rendered Vue.js Components
MIT License
1.18k stars 52 forks source link

Cannot read property '0' of undefined #31

Closed metinjakupi closed 4 years ago

metinjakupi commented 4 years ago

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 commented 4 years ago

Try to change your code to: `

   </LazyHydrate>`