this worked!! ```ts import { WorkerEntrypoint } from 'cloudflare:workers' export default class exte
this worked!!
import { WorkerEntrypoint } from 'cloudflare:workers'
export default class extends WorkerEntrypoint {
async fetch() {
return new Response('Hello from User Worker')
}
sum(args: number[]): number {
return args.reduce((a, b) => a + b)
}
}wranger@dispatch-namespaces-dev but local dev environment fails with*/* wrangler somehow to build/bundle correctly*.route.example.com And route it to the child worker using the subdomain.


wranger@dispatch-namespaces-dev[wrangler] Couldn't find `wrangler dev` session for "customer-worker-1" in namespace "workers-for-platforms-playground" to proxy to*/*wrangler*.route.example.comexport default {
async fetch(request, env) {
try {
// parse the URL, read the subdomain
let workerName = new URL(request.url).host.split('.')[0];
let userWorker = env.dispatcher.get(workerName);
return await userWorker.fetch(request);
} catch (e) {
if (e.message.startsWith('Worker not found')) {
// we tried to get a worker that doesn't exist in our dispatch namespace
return new Response('', { status: 404 });
}
// this could be any other exception from `fetch()` *or* an exception
// thrown by the called worker (e.g. if the dispatched worker has
// `throw MyException()`, you could check for that here).
return new Response(e.message, { status: 500 });
}
},
}; [ERROR] Received a malformed response from the API
upstream connect error or disconnect/reset before headers. reset reason: connection termination