Unrecoverable Syntax Error

I am working on JavaScript challenges. This is an error that I have seen several times and now it is inhibiting me from continuing, so I am addressing it.

I keep getting an error that triggers several other nonsensical errors and it reads, “Unrecoverable Syntax Error (x% scanned)” x being whatever percentage it has “scanned”. It seems to have no rhyme or reason and is queuing from something as simple as inputting { “return” }.

Help?

Usually if I get that there is a good reason. It can be frustrating to find the problem sometimes and the error messages aren’t much help. Usually I commenting out lines that might be causing a problem and using console.log statements to make sure things are working right and my data is what I think it is.

Do you have a an example?

I ran into the same problem during one of my challenges. My problem was just writing the return statement outside the function with an extra curly brace after the return statement; e.g.:

function myFunc {
var solution;
//enter code here
}
return solution;
}

Just remove the last curly brace and move the return statement inside the function.
Not sure if that’s the problem every time the “Unrecoverable Syntax Error” message appears, but hope this helps.

1 Like

It was the brace problem. Check carefully.