Skip to content

Node.js 26.14 reapplies synchronous ES module loading

The performance change shipped, broke require() under custom module hooks, got reverted days later, and is now back in this LTS release with the bug fixed.

Source: Node.js

Node.js 26.14.0, an LTS release published on 30 November, reapplies a change that makes most ES modules load synchronously, for faster module initialisation. It is not the change’s first outing: Node shipped it earlier in the 26.x line, then reverted it within days.

The revert happened because require() of an ES module with imports could fail with ERR_INTERNAL_ASSERTION in ModuleJobSync.syncLink(), specifically when a module.register() hooks module was still loading on the hooks thread. With a security release and an LTS transition due inside two weeks, the Node team pulled the change rather than risk it, and relanded it in 26.14.0 once the fix for that assertion failure was ready. The same release adds fs.mkstemp() for temporary files, a subprocess.timedOut property on child processes, and mockReturnValue plus promise helpers in the test runner.

# anything that calls require() on an ES module
# from inside a module.register() hooks module
# is the case that broke last time

Why it matters: if your app uses require() on ES modules, or registers custom module hooks with module.register(), run your test suite against 26.14.0 before rolling it out. Node’s own release notes single out exactly that combination as worth checking first.

The caveat: this is the same change that already caused a real regression once. The specific bug is fixed, but it is a sign the synchronous-loading path still has edge cases the Node team is finding as it ships.

Share

Related reading

More from The Wire

All briefs

node-tar patches a Windows RCE bug triggered by npm install

A newline-injection flaw in node-tar let a crafted archive forge its own file paths and run code during npm install on Windows. The fix landed in a string of releases up to 8.1.0 on 2 December.

via GitHub Security Advisories (isaacs/node-tar)