When using VUE Cli3, I encountered the following problems:
error: Parsing error: Unexpected token < at src\views\index.vue:1:1:
> 1 | <template>
| ^
| <div class="index">
| <router-view></router-view>
| <TabBar :data="tabbarData"></TabBar>
Looking up many websites, can not solve this problem, finally, in
https://stackoverflow.com/questions/53601579/parsing-error-unexpected-token-using-vuecli3-and-airbnb-eslint?r=SearchResults
Find a way
Open your.eslintrc.js file and find the Parser
Here’s my.eslintrc.js
module.exports = {
rules: {
'no-console': 'off',
"parser": "vue-eslint-parser"
},
}
Note:
This error is reported when I write “import”. In this case, I only need to put the “.eslintrc.js”
“Parser” : comment out “Vue-Eslint-Parser” and restart the project. Then, uncomment it and restart the project again with no error.
Why that should be, I don’t understand. If you have a better solution, please leave me a message, thank you!!
Read More:
- Vue の NPM run serve error: parsing error: unexpected token<
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing
- Unexpected syntax error: unexpected token<
- Syntax error: unexpected EOF while parsing
- Module build failed: SyntaxError: Unexpected token
- SyntaxError: unexpected EOF while parsing
- Solve the problem of syntax error: unexpected end of file or syntax error near unexpected token ` fi ‘error
- Error: unexpected syntax error: unexpected token<
- Syntax error near unexpected token `newline’script cannot be executed
- syntax error near unexpected token `else’
- Error resolution of unexpected token in JSON at position 0
- Uncaught syntax error: unexpected token ‘< 0‘
- Module parse failed:Unexpected token (9:6)
- Shell script syntax error near unexpected token ‘$’Do
- Unexpected token appears in JS
- syntax error near unexpected token `then’ problem solution
- Strange exception 001: invalid or unexpected token
- Unexpected token o in JSON at p
- Unexpected token u in JSON at position 0
- Syntax error near unexpected token ‘$’Do is reported when running bash file