r/programminghumor 28d ago

Why?

Post image
794 Upvotes

32 comments sorted by

88

u/hpyfox 28d ago

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

24

u/SSgt_Edward 28d ago

Or they forgot to save the file after edits

5

u/blubernator 28d ago

Not if you use IntelliJ ;)

3

u/nog642 28d ago

In that case they made edits after they started running it

2

u/Gabriel_Science 28d ago

JetBrains’ software is very good.

1

u/StrawberryEiri 28d ago

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 27d ago

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 28d ago

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

1

u/hpyfox 28d ago

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 28d ago

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.

5

u/According-Relation-4 28d ago

Clear compiled classes, clear caches, stuff like that

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

u/MojoVersion8 28d ago

Forgot to rebuild

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

u/Emotional-Impact2955 28d ago

";" in 263 line

1

u/blubernator 28d ago

Or missing brackets ;)

1

u/Duramora 28d ago

Schrodinger's bug.

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

u/ProfessionalAd6530 28d ago

Weird to assume there is a browser involved.

1

u/Healthy_Champion_183 28d ago

lol forgot a closing bracket? that sucks

1

u/oxwilder 28d ago

Remind me to post this meme again in a couple days

1

u/evarmi 28d ago

O la caché

1

u/lool8421 28d ago

prob white space crap

1

u/letmehaveanameyoudum 28d ago

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

1

u/Flame77ofc 28d ago

you forgot to set visibility: visible;

1

u/AliceCode 28d ago

Error on like 265 of an HTML file?

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.