Worker Service Binding not working

Hello, we are trying to call a function of workerB like in the service binding demo article but get an error on Worker A:
ERROR: env.WORKER_B.myFunction is not a function.

The service binding is
{binding="WORKER_B", service = "worker-b-stage"}

and the worker b has:
export default class extends WorkerEntry point { 
async fetch(..){..} 
async myFunction(headers) { 
    return anotherFunction(headers) 
}
...
}

On the worker deployment page the service binding is also showing the target worker correctly.
Everything seems like the demo example but we are not able to call the function. What are we missing?
Was this page helpful?