Local development with service bindings gives error when calling service
I am developing a worker locally using a service binding to another worker. When I call the fetch function of the bound worker (running in another terminal with
wrangler dev
) I get an error from worker middleware saying 'Invalid URL String`
The url I am passing is just cloned from the original request... has anyone seen this before?3 Replies
Here is what my code looks like:
That isn't how
new Request
should be constructed, you're passing an object (which inherently isn't a valid URL)oh, I am sorry. I didn't realize i was doing that wrong. what URL should I use when trying to hit another service with a service binding
I see what you mean. It is new Request (url, options)
I will fix that. Sorry for submitting a javascript issue.