Static GitHub Issues

[874] Async in module.exports : "Cannot assign to read only property 'exports' of object '#<Object>'"

prev: Memory leaks
next: Support for nuxt-link on SVG DOM nodes

Hello ! Anyone know what's wrong using async in Nuxt.js module.exports ? This works well if i simply return a Promise without async & await stuff.

module.exports = {

  async getPosts (perPage = 10) {
    const {data} = await axios.get(endpoint + '/posts?_embed&per_page=' + perPage)
    return data
  }

}
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c747">#c747</a>)</em></sub></div>