MeshioMeshio
News

Cloudflare Rebuilds Workers’ Module Registry for Better Node.js Compatibility

A new Workers runtime registry brings URL-based module resolution and stronger Node.js compatibility to Cloudflare deployments.

Meshio Newsroom
Meshio NewsroomSep 9, 2026

Cloudflare has rebuilt the module registry in workerd, the open-source core of its Workers runtime. As CloudFlare explains, the change is designed to make module loading faster, more standards-compliant, and more consistent with Node.js.

The update matters because Node.js compatibility involves more than reproducing individual APIs. Applications also rely on how ESM, CommonJS, and WebAssembly modules are resolved, compiled, cached, and connected. Workers now supports every stable Node.js API considered useful in a serverless environment, with those APIs enabled by default. Worker uploads can also reach 64 MiB on every plan, since Cloudflare removed the compressed bundle-size limit.

Developers can test the new behavior today by adding the new_module_registry compatibility flag to a Worker. The registry supports import.meta.url, import.meta.main, and import.meta.resolve(), while treating module specifiers as real URLs, including query strings and fragments. It also aligns node: built-ins to a single module instance, validates JSON import attributes, follows Node.js rules when require() loads an ES module, and standardizes loading errors.

The implementation could be especially useful for projects using modern build pipelines. Wrangler typically bundles code with esbuild, often collapsing dependencies into one very large script. The Cloudflare Vite plugin uses Vite 8 and Rolldown, which can emit multiple chunks. With the new registry, bundlers can perform fewer transformations and leave more resolution work to the runtime.

Modules can now compile lazily when first imported, and WebAssembly supports source-phase imports. For AI tool builders deploying larger JavaScript services, the practical payoff is a closer match between local Node.js behavior and production Workers—particularly when using dynamic imports, multiple modules, or native runtime features.

Source: CloudFlare

Comments

Log in to join the discussion