I am unable to bind a worker to another worker in ...
# workers-help
j
h
Are you trying to call the service binding, or are you just `console.log`ing your Environment?
j
@HardAtWork I am console.logging the environment both
console.log(env)
and
console.log(env.BINDING)
h
IIRC, most bindings aren't loggable. It should be present and callable, you just won't it in the logs.
j
I'll get it a shot, brb
Nope, not working:

https://cdn.discordapp.com/attachments/1105887547239976960/1105893540019572766/CleanShot_2023-05-10_at_12.25.522x.png

h
Just to make sure, can I see your
wrangler.toml
?
j
sure

https://cdn.discordapp.com/attachments/1105887547239976960/1105894354209472632/CleanShot_2023-05-10_at_12.28.172x.png

The binding works in the deployed worker, at least the deploy logs and dashboard show the binding
This is how I run wrangler, is the issue I am using
--experimental-local
?
Copy code
wrangler dev --test-scheduled --experimental-local
Well, switching to
--local
does not solve the issue either, same error
h
Um, I just realized something. Let me ask...
Do you have an instance of ``` wrangler dev --test-scheduled --local ```running for the
tenant-manager
worker?
j
i just noticed this in the docs: > For each Worker
^ Nope
That must be it
h
It occurred to me that
wrangler
wouldn't have any way of knowing what code to run for the Service Binding...
🤦
j
That was it, thanks!
I was wondering about that. Like would it mock or something. One step at a time was my thinking.
Thanks for your help!
h
The difficulty there is where does it get it from? Should it pull from the deployed version? That code may not be optimized for local dev.
2 Views