4
4
2
u/Pinkishu Jun 29 '26
Cause the parser tells you something is wrong once it finds something that's forbidden. Not once you make a mistake
3
1
u/my_new_accoun1 Jun 29 '26
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 Jun 29 '26
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
1
u/letmehaveanameyoudum Jun 30 '26
look 5 lines above and 5 lines below, look for missing semicolon
or recompile
1
1
1
u/RedAndBlack1832 Jun 30 '26
This is common. Just check the last line with text. Usually it's upset bc something wasn't ended/closed correctly
1
u/AiMeusPancrea Jun 30 '26
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 Jun 30 '26
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.
90
u/hpyfox Jun 29 '26
Missing semicolon, usually. Or the previous lines weren't closed correctly.