Bug with Service Worker Bindings - DOES NOT PROVIDE its own env

For Workers & Pages, what is the name of the domain?

mydomain.com

What is the error message?

env is not defined

What is the issue or error you’re encountering

There is no env with a Service Worker Binding

What steps have you taken to resolve the issue?

Tried many things - this is a bug at your end, because it should be very clearly in the documents, and it should come with its own env without problems or thinking about it.

Service bindings have env in my projects. Could you please share your code along with what you have tried so that we can see what you may be doing wrong?

3 Likes

I eventually managed to get it to work - turns out I needed to add a this.env (instead of env) to all of them (although this should be stated - there’s no transition guide for functions that work as fetch that I’m then converting into a Service Binding).

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.