@cloudflare/workers-utils@0.31.1
Patch Changes
-
#15009
b5c083bThanks @LeSingh1! - Use the inherited Worker name when generating container names in named environmentsWhen
containersis declared inside a named environment and the container has no explicitname, the default container name was built from the environment's ownnamefield.nameis inheritable, so an environment that doesn't redeclare it left that valueundefined, producing the errorMust have either a top level "name" and "containers.class_name" field defined, or have field "containers.name" defined.even though a top levelnamewas set — and, if the error was ignored, a container namedundefined-<class_name>-<env>.wrangler deploy --env stagingon the configuration above now generatesmy-worker-mycontainer-staging, matching the documentedworker_name-class_name[-env_name]default. Anamedeclared on the environment still takes precedence over the top level one.
{ "name": "my-worker", "env": { "staging": { "containers": [{ "class_name": "MyContainer", "image": "./Dockerfile" }] } } }