A couple of months back, I encountered this issue within my vue.js project. The error seems to be originating from lines 22, 23, and 24, which correspond to lines 45, 46, and 47 in the code block below.
{
"resource": "/C:/Users/Demo User/Documents/vue/mynewwebsite/src/App.vue",
"owner": "eslint",
"severity": 8,
"message": "Parsing error: Unexpected token, expected \",\"\n\n 22 | }\n 23 | }\n> 24 |\n | ^",
"source": "eslint",
"startLineNumber": 47,
"startColumn": 1,
"endLineNumber": 47,
"endColumn": 1
}
Ever since then, I've been scouring Stack Overflow, Google, and seeking advice from a friend to resolve this issue. Initially, I suspected it was a misplaced comma and attempted to add or remove commas at different locations, only to find out later that I had missed a curly brace (facepalm).
Below is the snippet of code from the script tag in App.vue
:
25 <script>
26 import Modal from './components/Modal.vue';
27 export default {
28 name: 'App',
29 components: { Modal, },
30 data() {
31 return {
32 title: 'my new website',
33 header: 'Modal Header',
34 text: 'modal content',
35 showModal: false,
36 showModalTwo: false
37 }
38 },
39 methods: {
40 toggleModal() {
41 this.showModal = !this.showModal;
42 },
43 toggleModalTwo() {
44 this.showModalTwo = !this.showModalTwo;
45 }
46 }
47 </script>