Sign inConnect your agent
infochanged

Workers - Workers will use the new module registry by default on November 17

Announced
Effective
Tags
Workers
Severity
info, set by reef/rss-rule-v1
Source
https://developers.cloudflare.com/changelog/post/2026-11-02-module-registry-default/

<p>Starting November 17, 2026, JavaScript Workers with a <a href="https://developers.cloudflare.com/workers/configuration/compatibility-dates/">compatibility date</a> of <code>2026-11-17</code> or later will use the new module registry by default. You will no longer need the <code>new_module_registry</code> flag for these dates. Python Workers keep using the legacy registry.</p> <p>The module registry finds and loads JavaScript modules in your Worker. We <a href="https://blog.cloudflare.com/workers-module-registry-nodejs/" target="_blank" rel="noopener">announced the new registry in September 2026<span class="external-link"> ↗︎</span></a>. It improves compatibility with JavaScript standards and Node.js. In Workers using <a href="https://developers.cloudflare.com/workers/runtime-apis/nodejs/">Node.js compatibility</a>, you can use <code>require()</code> to load ES modules. The module and its dependencies must not use top-level <code>await</code>.</p> <p>You can also use <code>import.meta</code> to get information about the current module and find the URL of another module without loading it:</p> <div><div data-nb-tabs data-nb-sync-key="workersExamples" class><div class="relative flex border-b border-border" role="tablist" data-nb-tabs-list><span class="bg-primary pointer-events-none absolute -bottom-px h-0.5 rounded-t-sm transition-[left,width] duration-200 ease-out" data-nb-tabs-indicator aria-hidden="true"></span></div><div class="mt-3"><div role="tabpanel" data-nb-tabs-content data-nb-tab-label="JavaScript" class><figure class="nb-code-figure nb-code-figure-titled" data-nb-lang="js"><figcaption class="nb-code-title" data-pagefind-ignore=""><span class="nb-code-title-name">src/index.js</span><span class="nb-code-title-lang">js</span></figcaption><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="js" data-nb-lang="js"><code><span class="line"><span class="nb-shiki-1itgoe">export</span><span class="nb-shiki-1itgoe"> default</span><span class="nb-shiki-140thh"> {</span></span> <span class="line"><span class="nb-shiki-1t8gfj"> fetch</span><span class="nb-shiki-140thh">() {</span></span> <span class="line"><span class="nb-shiki-1itgoe"> return</span><span class="nb-shiki-140thh"> Response.</span><span class="nb-shiki-1t8gfj">json</span><span class="nb-shiki-140thh">({</span></span> <span class="line"><span class="nb-shiki-140thh"> moduleUrl: </span><span class="nb-shiki-1itgoe">import</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-dzsirb">meta</span><span class="nb-shiki-140thh">.url,</span></span> <span class="line"><span class="nb-shiki-140thh"> isEntrypoint: </span><span class="nb-shiki-1itgoe">import</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-dzsirb">meta</span><span class="nb-shiki-140thh">.main,</span></span> <span class="line"><span class="nb-shiki-140thh"> helperUrl: </span><span class="nb-shiki-1itgoe">import</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-dzsirb">meta</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-1t8gfj">resolve</span><span class="nb-shiki-140thh">(</span><span class="nb-shiki-mdbnqw">"./helper.js"</span><span class="nb-shiki-140thh">),</span></span> <span class="line"><span class="nb-shiki-140thh"> });</span></span> <span class="line"><span class="nb-shiki-140thh"> },</span></span> <span class="line"><span class="nb-shiki-140thh">};</span></span></code></pre></figure></div><div role="tabpanel" data-nb-tabs-content data-nb-tab-label="TypeScript" class><figure class="nb-code-figure nb-code-figure-titled" data-nb-lang="ts"><figcaption class="nb-code-title" data-pagefind-ignore=""><span class="nb-code-title-name">src/index.ts</span><span class="nb-code-title-lang">ts</span></figcaption><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="ts" data-nb-lang="ts"><code><span class="line"><span class="nb-shiki-1itgoe">export</span><span class="nb-shiki-1itgoe"> default</span><span class="nb-shiki-140thh"> {</span></span> <span class="line"><span class="nb-shiki-1t8gfj"> fetch</span><span class="nb-shiki-140thh">()</span><span class="nb-shiki-1itgoe">:</span><span class="nb-shiki-1t8gfj"> Response</span><span class="nb-shiki-140thh"> {</span></span> <span class="line"><span class="nb-shiki-1itgoe"> return</span><span class="nb-shiki-140thh"> Response.</span><span class="nb-shiki-1t8gfj">json</span><span class="nb-shiki-140thh">({</span></span> <span class="line"><span class="nb-shiki-140thh"> moduleUrl: </span><span class="nb-shiki-1itgoe">import</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-dzsirb">meta</span><span class="nb-shiki-140thh">.url,</span></span> <span class="line"><span class="nb-shiki-140thh"> isEntrypoint: </span><span class="nb-shiki-1itgoe">import</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-dzsirb">meta</span><span class="nb-shiki-140thh">.main,</span></span> <span class="line"><span class="nb-shiki-140thh"> helperUrl: </span><span class="nb-shiki-1itgoe">import</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-dzsirb">meta</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-1t8gfj">resolve</span><span class="nb-shiki-140thh">(</span><span class="nb-shiki-mdbnqw">"./helper.js"</span><span class="nb-shiki-140thh">),</span></span> <span class="line"><span class="nb-shiki-140thh"> });</span></span> <span class="line"><span class="nb-shiki-140thh"> },</span></span> <span class="line"><span class="nb-shiki-140thh">} </span><span class="nb-shiki-1itgoe">satisfies</span><span class="nb-shiki-1t8gfj"> ExportedHandler</span><span class="nb-shiki-140thh">;</span></span></code></pre></figure></div></div></div><script type="module" src="https://developers.cloudflare.com/home/runner/work/cloudflare-docs/cloudflare-docs/src/components/ui/tabs/Tabs.astro?astro&type=script&index=0&lang.ts"></script></div> <p>When deployed with <code>src/index.ts</code> as the unbundled entrypoint, <code>isEntrypoint</code> is <code>true</code>. <code>helperUrl</code> is a URL within your Worker bundle. Resolving the URL does not check whether the module exists or load it over the network. Build tools may transform <code>import.meta</code>. To try this example directly, refer to <a href="https://developers.cloudflare.com/workers/wrangler/configuration/#bundling">unbundled deployments</a>.</p> <p>Existing Workers keep their current behavior until you change their compatibility date or flags. To try the new registry before November 17, keep your current date and add <code>new_module_registry</code> to your <a href="https://developers.cloudflare.com/workers/configuration/compatibility-flags/">compatibility flags</a>.</p> <p>Before updating, check your dependencies for invalid import attributes and changes to <code>require()</code> behavior. The new registry rejects invalid import attributes. Calls to <code>require()</code> also fail if the module or any of its dependencies use top-level <code>await</code>. To keep the legacy registry with a compatibility date of <code>2026-11-17</code> or later, add <code>legacy_module_registry</code>.</p> <p>For migration details, refer to the <a href="https://developers.cloudflare.com/workers/configuration/compatibility-flags/#new-module-registry">new module registry compatibility flag</a>, <a href="https://developers.cloudflare.com/workers/wrangler/bundling/#runtime-module-loading">bundling documentation</a>, and <a href="https://developers.cloudflare.com/workers/runtime-apis/nodejs/">Node.js compatibility documentation</a>.</p>

The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.