Spent 4 hours tracking down a time tracking bug that was just a missing semicolon | Freelance Life - Freelance Forum - The Community for Independent Professionals
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?
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.