I am using vue.js and getting this error "Uncaught SyntaxError: let is disallowed as a lexically bound name". When I debug it shows a blank screen and this error in the console.
I have Googled but nothing helpful was found.
Here is my Vue code:
let Task = {
props: ['task'],
template: `
<div>
<div class="tasks">
{{ task.body }}
</div>
</div>
`
},
let Tasks = {
components:{
'task': Task
},
data: {
return {
tasks: [
{id: 1, body: 'Task One', done: false }
],
}
},
template: `
<div>
<task></task>
<form action="">
form
</form>
</div>
`
},
let app = new Vue({
el:'#app',
components: {
'tasks': Tasks
'task': Task
}
})
A syntax error occurs when you make a mistake while writing the code. What happens when this error occurs? When this error takes place the compiler becomes unable to process the file. And then it fails to display your website.
And when you pick a piece of code from somewhere or try the demonstrated thing on your website then at times it displays an error message ‘Syntax Error, Unexpected………..path…….’. This means that a syntax error has occurred on your WordPress website.
1 First of all you have to download FileZilla. ... 2 In the syntax error message there must be a path. ... 3 After this you will be able to determine exactly which file or folder is the root cause of this error. ... 4 Once you are done with making . ... 5 Here, you have to click on ‘Ye . ...
If the parentheses and brackets have not been used in a balancing manner in the command then it can cause a syntax error in the code.
If you are separating your declarations with commas, you should not repeat let
. either remove let
from each declaration, or use semi-colons instead.
Example:
let a = {}, b = 5, c = function(){}; // OK
let a = {}; let b = 5; // OK
let a = {}, let b = 5; //Not OK -- error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With