Skip to content

confusion around new_module_registry compatibility flag and date usage #7606

Open

Description

@thescientist13

Was trying out the new_module_registry flag announced in this blog post and noticed a confusing behavior).

I have a wrangler.toml file as such

name = "cloudflare-workers-demo"
pages_build_output_dir = "./public"
compatibility_flags = ["new_module_registry"]

But when I deploy, I get this message

Error: Failed to publish your Function. Got error: compatibility_flags cannot be specified without a compatibility_date

However, the blog post states to omit the compatibility_date

It doesn't have a default on date yet, so it won't turn on automatically for your Worker, old or new, no matter what compatibility date it's using. You will need to add the flag explicitly.

Interestingly, I managed to get one preview build to pass after having deleted the wrangler.toml file which was confusing because my example API using import.meta.url worked?

So not sure what I should be using?


On a related note, but for this link in the blog post

You can start using it today by enabling the new_module_registry compatibility flag in your Worker.

I get a 404 for it
https://developers.cloudflare.com/workers/configuration/compatibility-flags/new-module-registry
Image

Activity

  1. thescientist13 commented on Oct 3, 2026

    @thescientist13
    Author

    Ok, it looks like I was just able to add a compatibility_date and a production build passed and my test API using import.meta.url worked?

    name = "cloudflare-workers-demo"
    pages_build_output_dir = "./public"
    compatibility_flags = ["new_module_registry"]
    compatibility_date = "2024-06-01"

    That may be worth clarifying in the blog post if a date is still needed. (or the docs, but i can't read them yet 😊)

  2. thescientist13 commented on Oct 3, 2026

    @thescientist13
    Author

    Ah, I guess this is this is somewhat covered / cleared up by the docs I suppose. Looks like it is always needed, and I read the blog post example too literally? 😅
    https://developers.cloudflare.com/workers/configuration/compatibility-dates/#setting-compatibility-date

    When you start your project, you should always set compatibility_date to the current date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions