Static GitHub Issues

[598] Async not recognized/working as intended

prev: Inline styles do not update properly when SSR
next: Error: head script dangerouslyDisableSanitizers

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?

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