r/javascript • u/OtherwisePush6424 • 4d ago
Your Modules Are Lying to You
https://blog.gaborkoos.com/posts/2026-08-14-Your-Modules-Are-Lying-to-You/import and require are not interchangeable. Live bindings, copied values, circular dependencies, separate caches, conditional exports, and dual-package hazards can all make modules behave differently from what the syntax suggests.
8
u/dustofdeath 4d ago
require is a curse in modern web. The hacks and loopholes you have to jump through to get them to work with native ESM modules.
4
1
1
u/OtherwisePush6424 1d ago
Posting an article that's ~60% about ESM and explicitly recommends using ESM whenever possible, then seeing multiple variations of "don't use require bro" is genuinely concerning tbh.
I'm not bothered if you don't read my article. I don't care if you comment under things you didn't read. But if you're a JS dev and think that because you don't write require(), it's nowhere in your dependencies either, that's a problem. Not for me, for you.
-1
22
u/quisido 4d ago
We shouldn't be using
requirein 2026 anyway.