Home

Issue: 2071

SSR error when Writing API in Nuxt with Router Module?

[issue link]

I use Nuxt with Router Module
Currently, i write api like this:

<template>
  <div class="row flex">
    {{posts.id}}
  </div>
</template>
<script>
  import axios from 'axios'
  import Item from '~/components/feeds/Post.vue'
  export default {
    async asyncData ({ store, route }) {
      let { data } = await axios.get('http://localhost:8000/api/v1/feeds/' + route.params.id + '/')
      return {
        posts: data
      }
    },
    components: {
      'post-detail': Item
    }
  }
</script>

I get this error:
image
How can I fixed this.
@Atinux Please help my with your Router Module package.

This bug report is available on Nuxt.js community (#c1837)