Looks like `--x-json-config` but yeah, toml will work too
Looks like
--x-json-config but yeah, toml will work too--x-json-configHello, ${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"
}[wrangler] Couldn't find `wrangler dev` session for "customer-worker-1" in namespace "my-namespace" to proxy to%(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);Hello, ${name}!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"wrangler devYour 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