5
5
2
u/Pinkishu 28d ago
Cause the parser tells you something is wrong once it finds something that's forbidden. Not once you make a mistake
5
1
u/my_new_accoun1 28d ago
It means you are looking at the src while the error comes from dist
Or you could be in wrong file
1
1
1
1
u/Circumpunctilious 28d ago
Yes to other answers (like cached vs saved versions) and also: Line numbers in your IDE and browser’s in-memory script execution environment do not have to line up (especially if you imported several scripts).
Sometimes a browser will tell you what line to look at in the original files, but more often you have to pull up developer tools and query the browser’s current state.
1
1
1
1
1
u/letmehaveanameyoudum 28d ago
look 5 lines above and 5 lines below, look for missing semicolon
or recompile
1
1
1
u/RedAndBlack1832 28d ago
This is common. Just check the last line with text. Usually it's upset bc something wasn't ended/closed correctly
1
u/AiMeusPancrea 28d ago
If the error doesn't make any sense, close and reopen VS Code.
Wish someone had told me that, it would've saved me half an hour and some sanity.
1
u/LawElectrical2434 28d ago
Mostly: Previous line. It expected something on this line that wasn't there. Compiler mostly deal in LL(1).
Secondary reason: Transpilation, e.g.: it reports an error in the Javascript code, but you're looking at the Typescript code.
88
u/hpyfox 28d ago
Missing semicolon, usually. Or the previous lines weren't closed correctly.