that's the config for the dispatch worker no? Im following the local setup guide and it says to add
that's the config for the dispatch worker no? Im following the local setup guide and it says to add dispatch_namespace to customer-worker-1
dispatch_namespaces config is not being picked up either?wrangler dev path/to/script) or the main config field.main?dispatch-namespaces-dev branch I'm not sure that supports wrangler.json by default yet..--x-json-config but yeah, toml will work tooHello, ${name}! });npx wrangler@dispatch-namespaces-dev dev --x-json-config correct?"vars" modify env but "dispatch_namespaces" doesn't?"dispatch_namespaces" doesn't work in local dev mode right now, because I tried deploying and env does have a DISPATCHER key in prod. Is that a bug? The output from wrangler dev implies that it is working: "devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.6.4",
"vitest": "~2.1.9",
"wrangler": "dispatch-namespaces-dev"
}(method) DispatchNamespace.get(name: string, args?: {
[key: string]: any;
}, options?: DynamicDispatchOptions): Fetcher
@param name — Name of the Worker script.
@param args — Arguments to Worker script.
@param options — Options for Dynamic Dispatch invocation.
@returns — A Fetcher object that allows you to send requests to the Worker script.
@throws — If the Worker script does not exist in this dispatch namespace, an error will be thrown. .get("/", async (c) => {
const customerScript = c.env.DISPATCHER.get("user-worker-dev", {
hook: "afterCreate",
table: "order",
});
return await customerScript.fetch(c.req.raw);npx wrangler@dispatch-namespaces-dev dev --x-json-config"vars": {
"MY_VARIABLE": "production_value",
},
"dispatch_namespaces": [
{
"binding": "DISPATCHER",
"namespace": "<NAMESPACE_NAME>",
},
],export default {
async fetch(req, env) {
console.log('env:', Object.keys(env));env: [ 'MY_VARIABLE' ]"vars""dispatch_namespaces""dispatch_namespaces"Your worker has access to the following bindings:
- Vars:
- MY_VARIABLE: "production_value"
- Dispatch Namespaces:
- DISPATCHER: <NAMESPACE_NAME> [connected to remote resource]
⎔ Starting local server...
[wrangler:inf] Ready on http://localhost:8787