5
Spent 4 hours tracking down a time tracking bug that was just a missing semicolon
I was pulling my hair out over a client's invoice that kept showing 0.00 hours logged. Turns out the whole thing was because I forgot a semicolon in my custom script and it was silently failing. Has anyone else had a tiny coding mistake eat up their whole afternoon?
2 comments
Log in to join the discussion
Log In2 Comments
adam4141mo ago
Never heard of a semicolon causing silent failures though, that sounds more like a try-catch issue.
0
margaretc421mo ago
Semicolons can absolutely cause silent failures if you're in a context where a missing one means two lines get merged in a weird way. In JavaScript, if you're relying on ASI and your code depends on a specific return or property access, a semicolon skip can lead to something that looks like it's running but is actually doing something else entirely. I've seen it happen with something like `return {foo: bar}` where an extra semicolon before the brace breaks the implicit object return. Not a try-catch problem at all.
3