How we rebuilt Cloudflare Workers’ module registry for Node.js compatibility

Cloudflare rewrote its Workers module registry to match Node.js, making larger apps and better module handling possible.

How we rebuilt Cloudflare Workers’ module registry for Node.js compatibility

Why Now

The update follows Cloudflare’s push to support all stable Node.js APIs in Workers, removing the 64 MiB bundle limit.

What Happened

The new registry, enabled via the new_module_registry flag, supports import.meta features, URL-based specifiers, consistent error classes, lazy compilation, and WebAssembly imports. It aligns module resolution with Node.js, ensuring built‑ins resolve to the same instance and require() follows Node.js rules.

Why It Matters

Developers can now deploy larger, more complex Node.js applications on Cloudflare Workers with fewer compatibility headaches, improving performance and developer experience. It also tightens the runtime’s adherence to web standards.

The Limitation

The changes are behind a compatibility flag and may require code adjustments; full documentation is still in progress.

What You Can Do

Enable the new_module_registry flag in your Worker and test your Node.js code for compatibility.

Source

Read original source
← Back to all articles