25
Warning: I spent 6 hours debugging a single missing semicolon in JavaScript
It took me that long to find it because I was looking at the wrong part of the code, and now I triple check every line before I run anything.
2 comments
Log in to join the discussion
Log In2 Comments
gavina7317d ago
Used to be all smug about semicolons being optional in JS. Then I spent 45 minutes chasing a bug that only showed up in Safari and suddenly I'm a semicolon truther.
1
oscar_ellis17d ago
The prettier plugin saved my sanity on this exact thing. Just set it up to auto-add semicolons on save (took like 2 minutes) and I never think about it anymore. Safari specifically is the worst about line break parsing, especially when you have something like a return statement with a newline. Honestly, I'd rather let the tool handle it than have another 45 minute debugging session.
6