Joyee Cheung made some waves in Node land last month:
Since ESM was shipped in Node.js, for many years, it was possible to
import cjs
, but not possible torequire(esm)
. The frustration ofERR_REQUIRE_ESM
has bothered many and probably has been the primary source of wasted hours in the Node.js ecosystem. If package authors wanted to make sure that both CJS and ESM users can consume their package, they either had to continue shipping their modules as CJS, or ship both the CJS and ESM version
Apparently, it will go out in v22, which isn’t out yet but should be soon.