Harm #1: Confused Debuggers
Module loaders often make debugging difficult in a number of obvious and subtle ways.
Compression, transpiling, and other pre-processing in the pipelines that typically support module loaders (which are not always necessary, but are in use in tandem consistently) rewrite scripts from the input module to the source that actually gets parsed by the browser. There is a frequent mismatch when debugging in the browser between your actual source and the code you see in the debugger. Source Maps are helping this, but support for them in both browsers and tool chains is still underwhelming.
Often times, even when the source is unchanged or the source maps work properly, the simple nature of the dynamic tags used by module loaders causes issue. Debuggers might not recognize the same script between page loads, without an inline <script> node, causing breakpoints to be lost, for example.
It is very hard to justify module loaders on their benefit when they can make debugging your code, the very thing they aim to help you organize and simplify, so much more difficult.
Harm #2: Module Load Order
Perhaps the single most common and frustrating thing to deal with in module loaders is the order of load or script execution. Compared to the expected load order of a series of <script> tags in your page, understanding when each module will be executed can be an exercise in frustration quickly.
Execution order from module loaders is usually a factor of the race to which modules are downloaded first and the inter-module dependencies defined which will keep actual execution of a downloaded script pending until its dependencies have all been loaded.
There is obvious merit here and helping us to define and understand dependencies, and to provide clear references between them in the form of things like require() calls, is certainly admirable.
However, the fact is that the vast majority of our projects don’t have such complicated intra-module dependencies to really justify this.
Harm #3: Workflow Complication
Simply put, using a module loader instead of simple scripts is simply harder to work with.
There are well known difficulties integrating other libraries that don’t use the same module system. That there are multiple such systems makes this worse. Library authors are forced to provide extra wrappers for all the different loaders or pick a side when their users have or care not to.
When you bring in new developers to a project or when a developer finds a library she wants to use which has decided to distribute itself as a module in a specific system, like RequireJS, there is an added barrier to use with little apparent benefit to a developer who just expected another <script> tag to their existing project. Is it worth integrating someone else’s preferred loader to use their simple library? I fear this may lead to fragmentation of our already disperse ecosystem.
There is a case for module loaders, which can only really be made when the costs are outweighed by the benefits, and this is only really verified when the costs of not using a module loader are greater than the costs when you do use a module loader. Costs of not using a module loader are incurred when you have a large enough body of code that loading all of it at the start of your app is detrimental to performance, user experience, or both.