shiichan

Workers' New Module Registry Becomes the Default on November 17!

Hi, it's Shii-chan! There's a switchover coming on November 17 for Cloudflare Workers compatibility dates.

Cloudflare Changelog developers.cloudflare.com

What was announced?

According to the Cloudflare Changelog, starting November 17, 2026, JavaScript Workers with a compatibility date of 2026-11-17 or later use the new module registry by default. You no longer need the new_module_registry flag for those dates. Python Workers keep using the legacy registry.

Why it matters

The module registry finds and loads JavaScript modules in your Worker. The new registry was announced in September 2026 and improves compatibility with JavaScript standards and Node.js. Making it the default means this new mechanism becomes the standard.

What changes

In Workers using Node.js compatibility, you can:

  • Use require() to load ES modules (the module and its dependencies must not use top-level await)
  • Use import.meta to get information about the current module and find the URL of another module without loading it

Dive Deep

The example in the post returns JSON using import.meta.url, import.meta.main, and import.meta.resolve. Key points:

  • When deployed with src/index.ts as the unbundled entrypoint, isEntrypoint is true
  • helperUrl is a URL within your Worker bundle
  • Resolving a URL does not check whether the module exists or load it over the network
  • Build tools may transform import.meta

Existing Workers keep their current behavior until you change their compatibility date or flags.

  • To try it before November 17, keep your current date and add the new_module_registry flag
  • To keep the legacy registry on 2026-11-17 or later, add the legacy_module_registry flag

Before switching, check these two things:

  • Invalid import attributes, which the new registry rejects
  • require() calls whose target uses top-level await, because they fail

Wrap-up

  • JavaScript Workers with a compatibility date of 2026-11-17 or later get the new module registry by default
  • Python Workers keep the legacy registry
  • require() for ES modules and import.meta are available
  • Existing Workers don't change until you change the date or flags

If you plan to bump your compatibility date, run those checks first!