Is it possible to use the same DO for

Is it possible to use the same DO for two environments within a worker? I'm seeing this error:
- "env.dev" environment configuration
- The following bindings are at the top level, but not on "env.dev".
This is not what you probably want, since "durable_objects" configuration is not inherited
by environments.
Please add a binding for each to "env.dev.durable_objects.bindings":
- "env.dev" environment configuration
- The following bindings are at the top level, but not on "env.dev".
This is not what you probably want, since "durable_objects" configuration is not inherited
by environments.
Please add a binding for each to "env.dev.durable_objects.bindings":
but I don't want to create a separate DO for the dev environment
1 Reply
Larry
Larry3mo ago
I believe the big reason you have to specify the DO config for each environment is that because it's common for the DO Class definition to have a tight coupling between the code and the schema. You could specify a migration for say DEV and STAGING that have the new version of your DO Class definition while leaving PROD with the old definition. I'd love to see a discussion from some of the experts on here on how they use environments to evolve their application over time.

Did you find this page helpful?