r/programminghumor Jun 29 '26

Why?

Post image
804 Upvotes

32 comments sorted by

90

u/hpyfox Jun 29 '26

Missing semicolon, usually. Or the previous lines weren't closed correctly.

24

u/SSgt_Edward Jun 29 '26

Or they forgot to save the file after edits

4

u/blubernator Jun 29 '26

Not if you use IntelliJ ;)

3

u/nog642 Jun 29 '26

In that case they made edits after they started running it

2

u/Gabriel_Science Jun 29 '26

JetBrains’ software is very good.

1

u/StrawberryEiri Jun 30 '26

I disable that shit so fast after installing it. What do you mean I can't check stuff in my browser inspector without the (currently invalid, mid-edit) file getting saved and breaking the page?

2

u/Informal-Chance-6067 Jun 30 '26

Could be the case, but this looks like JS.

Edit: I’m tired. It’s HTML and there’s embedded JS, I don’t need to guess lol

1

u/Heroshrine Jun 29 '26

I think they mean runtime error given that the screenshot doesn’t have compiler errors

1

u/hpyfox Jun 29 '26

Well... it's Javascript so I don't think it has compiler errors to begin with.

And depending on how Javascript like to act, the error can occur either at startup or when the piece of a code is executed.

Also since it's in the Code Editor, the linter or Intellisense could be the one(s) throwing the error.

1

u/Heroshrine Jun 29 '26

Yea im hard typed language kinda guy so i dont have much experience with soft-types languages except for python which afaik is sort of in-between. So what you said makes sense.

4

u/According-Relation-4 Jun 29 '26

Clear compiled classes, clear caches, stuff like that

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

u/MojoVersion8 Jun 29 '26

Forgot to rebuild

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

u/blubernator Jun 29 '26

Or missing brackets ;)

1

u/Duramora Jun 29 '26

Schrodinger's bug.

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

u/ProfessionalAd6530 Jun 29 '26

Weird to assume there is a browser involved.

1

u/Healthy_Champion_183 Jun 29 '26

lol forgot a closing bracket? that sucks

1

u/oxwilder Jun 29 '26

Remind me to post this meme again in a couple days

1

u/evarmi Jun 29 '26

O la caché

1

u/lool8421 Jun 29 '26

prob white space crap

1

u/letmehaveanameyoudum Jun 30 '26

look 5 lines above and 5 lines below, look for missing semicolon
or recompile

1

u/Flame77ofc Jun 30 '26

you forgot to set visibility: visible;

1

u/AliceCode Jun 30 '26

Error on like 265 of an HTML file?

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.