[Vue warn]: Error in render: “TypeError: Cannot read property ‘wp:featuredmedia’ of undefined – REST API

I found a solution after I’ve read how vue works under the hood when the data are updated. My problem was that the Array.push() function was adding the new fetched data inside the original array as a nested array. This was causing the problem with the v-for loop that was not able to iterate over the nested array.
Someone has suggested me to use the spread operator, but this solution was updating the original data correctly, but at the same the previous posts were replaced at all by the new data and this isn’t the behaviour that I was expect from an infinite scroll loading. The code I have now works fine, the best approach I’ve found and tested is to use the server-side rendering to generate the initial posts and then at scroll use vue to load new items. In the code I’m using the load

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
(function($){
  $(document).ready(function(){

  var page = 1;
  var canBeLoaded = true;
  var app = new Vue({
    el: '#app',
    data: {
      posts: []
    },
    created: function() {
      window.addEventListener('scroll',this.loadItems);
    },
    destroyed: function() {
      window.removeEventListener('scroll', this.loadItems);
    },
    mounted: function(){
      console.log('mounted fired');
// this part works fine, but I've opted for a server-side rendering for the initial contents
      var self = this;
      $.getJSON( 'wp-json/wp/v2/posts?categories=3&page=1&per_page=10&_embed', function(data){
        console.log(data);
        self.posts = data;
      });
    },
    methods: {
      loadItems: function(){
        var bottomOffset = 2000;
        var self = this;
          if( $(document).scrollTop() >= ( $(document).height() - $(window).height() - 10 ) && canBeLoaded == true ){
            console.log('loadItems method fired');
            console.log(page);
            canBeLoaded = false;
            $.getJSON( 'wp-json/wp/v2/posts?categories=3&page="+page+"&per_page=10&_embed', function(data){
              if( data.length > 0 ){
                self.posts = self.posts.concat(data);
                page++;
              }
            }).done(function(){
              canBeLoaded = true;
            });
          }
      }, // end loadItems
    } // end methods
  });

  // for debug and prototype only - remove in production

  // var root = $('html, body');
  //   $('#scroll-link').on('click', function(e){
  //     e.preventDefault();
  //       root.animate({
  //           scrollTop: $( $.attr(this, 'href') ).offset().top
  //       }, 500);
  //       return false;
  //   });
  //

  }); // doc ready
}(jQuery));
</script>