Javascript [Vue warn]:渲染时出错:“Vue warn”;TypeError:无法读取属性';id';“无效”的定义;

Javascript [Vue warn]:渲染时出错:“Vue warn”;TypeError:无法读取属性';id';“无效”的定义;,javascript,vue.js,Javascript,Vue.js,我目前正在构建HackerNews的克隆,遇到以下错误: vue.esm.js?efeb:591 [Vue warn]: Error in render: "TypeError: Cannot read property 'id' of null" found in ---> <Homepage> at src/components/New.vue <App> at src/App.vue <Root> vue.es

我目前正在构建HackerNews的克隆,遇到以下错误:

vue.esm.js?efeb:591 [Vue warn]: Error in render: "TypeError: Cannot read property 'id' of null"

found in

---> <Homepage> at src/components/New.vue
       <App> at src/App.vue
         <Root>
vue.esm.js?efeb:591[vue warn]:呈现错误:“TypeError:无法读取null的属性“id”
发现于
--->在src/components/New.vue
在src/App.vue
我不确定这个错误是怎么发生的!以前有人遇到过这种情况吗? 这是否意味着错误在New.vue中?这是代码:

<script>
import axios from 'axios'
import Item from '@/components/Item'
export default {
  name: 'Homepage',
  components: {
    'item': Item
  },
  data: function () {
    return {
      err: '',
      stories: []
    }
  },
  created: function () {
    axios.get('https://hacker-news.firebaseio.com/v0/newstories.json')
      .then((result) => {
        this.results = result.data.slice(0, 10)
        this.results.forEach(element => {
          axios.get('https://hacker-news.firebaseio.com/v0/item/' + element + '.json')
            .then((result) => {
              this.stories.push(result)
            })
            .catch((err) => {
              console.log(err)
            })
        })
      })
      .catch((err) => { this.err = err })
  }
}
</script>

从“axios”导入axios
从“@/components/Item”导入项目
导出默认值{
名称:'主页',
组成部分:{
“项目”:项目
},
数据:函数(){
返回{
错误:“”,
故事:[]
}
},
已创建:函数(){
axios.get()https://hacker-news.firebaseio.com/v0/newstories.json')
。然后((结果)=>{
this.results=result.data.slice(0,10)
this.results.forEach(元素=>{
axios.get()https://hacker-news.firebaseio.com/v0/item/“+元素+”.json')
。然后((结果)=>{
this.stories.push(结果)
})
.catch((错误)=>{
console.log(错误)
})
})
})
.catch((err)=>{this.err=err})
}
}

顺便说一句,我的代码可以编译并显示使用
数据()的HTML。
。来自
New.vue
的一个。主页
如果(!result.data)返回
;应该处理意外情况。在成功回调中处理结果之前,请将其放入。