error Parsing error: Unexpected token import
See original GitHub issueTell us about your environment
- ESLint Version: 4.8.0
- eslint-plugin-vue Version: 3.13.0
- Node Version: 7.5.0
Please show your full configuration:
module.exports = {
root: true,
parserOptions: {
sourceType: 'module',
ecmaVersion: 8,
},
extends: [
'standard',
'plugin:vue/recommended' // or 'plugin:vue/base'
],
"env": {
"browser": true,
},
// add your custom rules here
'rules': {
"indent": ["error", 2],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "never"],
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
// trailing comma
'comma-dangle': ['error', 'always-multiline'],
}
}
What did you do? Please include the actual source code causing the issue.
<template>
<div id="app">
</div>
</template>
<script>
export default {
name: 'app2',
components: {
'component1': () => import('./components/Component1.vue'),
},
data() {
return {
isShowComponent: false,
};
},
methods: {
showComponent: function(event) {
this.isShowComponent = true;
},
},
};
</script>
<style scoped lang="scss">
</style>
What did you expect to happen?
What actually happened? Please include the actual, raw output from ESLint.
src/App.vue 16:25 error Parsing error: Unexpected token import
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Parsing error: Unexpected token `import` · Issue #11189
I'm not sure I understand the problem. When using the default parser and sourceType: "module" , the word import becomes a keyword token...
Read more >Dynamic Imports for Code Splitting cause: ESLint Parsing ...
My code runs and works as expected when using npm run dev and npm run build , but this parsing error prevents the...
Read more >ESLint Parsing error: Unexpected token - rockyourcode
ESLint throws some errors: error Parsing error: The keyword 'import' is reserved or, when using JSX: error Parsing error: Unexpected token ...
Read more >eslint/eslint - Gitter
I am having an issue with ESLint while deploying my react app to Heroku. I am getting this error "Oops! Something went wrong!...
Read more >import.meta.url - Parsing error: Unexpected token import
You received this message because you are subscribed to the Google Groups "ESLint" group. To unsubscribe from this group and stop receiving ...
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
Sorry for the issue. I missed
"parser": "babel-eslint"
option in my.eslintrc.js
config. Please, close the issue.https://vuejs.github.io/eslint-plugin-vue/user-guide/#what-is-the-use-the-latest-vue-eslint-parser-error