To quote the author: "not using any semicolons at all is a very popular trend in JS these days, so it is very possible this problem might happen in the real world"
This is the crux of the problem. Javascript programmers often follow trends, not sane practice. Looking at the code, for some reason there's a semi-colon before "require" invocations as well.
I don't even know what to say, at this point. Everyone is fired.