Unexpected token after `async`
See original GitHub issueTell us about your environment
- ESLint Version: 4.3
- eslint-plugin-vue Version: 3.11.0
- Node Version: 8.1.4
Please show your full configuration:
module.exports = {
root: true,
extends: [
'dwing',
'plugin:vue/recommended'
],
rules: {
'global-require': 0,
'import/extensions': [2, 'always', { js: 'never', vue: 'never' }]
},
settings: {
'import/resolver': {
webpack: {
config: 'build/webpack.config.js'
}
}
}
};
What did you do? Please include the actual source code causing the issue.
const actions = {
async getAllData({ commit }) {
await this.getAllData();
}
};
export default actions;
// or this
export const getAllData = async ({ commit }) => {
await this.getAllData();
}
What did you expect to happen?
What actually happened? Please include the actual, raw output from ESLint.
file: 'file:///Users/willin/Desktop/vuetify-demo/src/store/actions.js' severity: '错误' message: 'Parsing error: Unexpected token getAllData' at: '2,9' source: 'eslint'
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
SyntaxError: Unexpected token function - Async Await Nodejs
I tried to use Babel as Quentin suggested, But, I am getting the following error still. Updated Code- require("babel-core/register"); require("babel-polyfill"); ...
Read more >Unexpected token error after adding await keyword to ...
Dylan Sather (Pipedream) : Hi , getting used to async / await and asynchronous programming in JS can take a long time even...
Read more >SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >SyntaxError: Unexpected token function - Async Await Nodejs
JavaScript : SyntaxError: Unexpected token function - Async Await Nodejs [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] ...
Read more >Async unexpected token function - App Platform
I'm writing a client side app for freshworks crm. I'm getting error on pack and validate. Its been running fine with “fdk run”...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Async functions have been added in ECMAScript 2017. You have to have
ecmaVersion: 2017
orecmaVersion: 8
.@JounQin I’m sure because I implemented it.