Using Durable Objects in Dev Environment

In my
wrangler.toml
file I have this structure:

[env.dev]
vars = { ENVIRONMENT = "dev" }

[env.staging]
vars = { ENVIRONMENT = "staging" }

[env.production]
vars = { ENVIRONMENT = "production" }


I created a Durable Object at the top level and I get this message when I launch my Worker in
dev
mode:

- "env.dev" environment configuration
      - "durable_objects" exists at the top level, but not on "env.dev".
        This is not what you probably want, since "durable_objects" is not inherited by
  environments.
        Please add "durable_objects" to "env.dev".


So I changed my configuration and added this under the
dev
section:

[env.dev]
vars = { ENVIRONMENT = "dev" }

[[durable_objects.bindings]]
name = "MEMBER_COUNT_DEV"
class_name = "MemberCount"

[[migrations]]
tag = "v1"
new_classes = ["MemberCount"]


But I still get the same message. This is not how you add DOs to environments.

What am I doing wrong. I followed a similar example in the docs about adding a KV store to multiple environments.
Was this page helpful?