Home

Issue: 598

Async not recognized/working as intended

[issue link]

I’m trying to fetch some data with nuxtServerInit like so:

async nuxtServerInit ({ commit }, context) {
  if (context.req.headers.cookie) {
    if (context.req.headers.cookie.split(';').find(c => c.trim().startsWith('token='))) {
      const token = context.req.headers.cookie.split(';').find(c => c.trim().startsWith('token=')).substr(7)
      await dispatch('CHECK_USER', token)
    }
  }
}

But I get the following error:
screen shot 2017-04-21 at 11 12 10 am

And ideas why that is?

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