Nuxt.js: Async/Await not working since v1.0.0

Created on 16 Jan 2018  路  4Comments  路  Source: nuxt/nuxt.js

Hi!

I've tried updating my RC11 nuxt.js project to V1.1.1, but it failed with some packages, so I decided to start fresh.

Initialized a new project via vue init nuxt-community/starter-template

Everything went fine up till' I tried using async/await in the store, later in methods.

I'm getting the following error everytime:

Parsing error: Unexpected token FUNCTION_NAME

This happens both in store and in components/pages.

Here's my stores action:

export const actions = {
  async reset ({ dispatch, commit }) {
    commit('SET_USER', null)
    await dispatch('updateToken', null)
  }
}

which gives the following error:

Parsing error: Unexpected token reset

I'm using the latest node version btw, V9.4.0

Thanks in advance!

This question is available on Nuxt.js community (#c2273)

Most helpful comment

Because I changed it this morning and fixed it 5 minutes ago 馃槃

All 4 comments

It's due to bad ESLint configuration, please see the correct .eslintrc.js: https://github.com/nuxt-community/starter-template/blob/master/template/.eslintrc.js

Works like a charm now, thanks.

What was the root of the problem?

I've initialized the template via vue init nuxt-community/starter-template, why didin't it pull the correct .eslintrc.js file?

Because I changed it this morning and fixed it 5 minutes ago 馃槃

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikekidder picture mikekidder  路  3Comments

surmon-china picture surmon-china  路  3Comments

vadimsg picture vadimsg  路  3Comments

vadimsg picture vadimsg  路  3Comments

uptownhr picture uptownhr  路  3Comments