Workers Sites and "__STATIC_CONTENT is not defined"


I’m trying to host a static html site (no site generators, just plain vanilla html files) using workers sites on “

I can see the files in WorkersKV.

In the wrangler.toml file I have the following config:

name = “domain .com”
account_id = “the correct account id number”
type = “webpack”
bucket = “./public”
entry-point = “./workers-site”
route = “domain . com/*”
zone_id = “the correct zone id”

In the workers tab of Cloudflare I have a route for “*” set up.

I’ve also set up two A records in Cloudflare, one for naked domain and one for www, both pointing to a fake address and proxied to Cloudflare.

However, the site is not resolving. I get a “__STATIC_CONTENT is not defined” error.

I can’t get index.html to load or a even a single .jpg image that I can see are uploaded to KV.

Any suggestions on what to look at next? There’s no mention of “__STATIC_CONTENT is not defined” in the documentation.

1 Like

Were you able to set the DEBUG variable to true to enable more verbose error messages, @langoj?

Debug is set to “true” but now rather than showing “__STATIC_CONTENT is not defined” I get a 522 error message.

Cloudflare support sent over a cryptic screenshot letting me know my code was minified (which it’s not) and this screenshot.


I’m in the process of trying to find a consultant to figure this out. I can’t get anywhere with Cloudflare support since they won’t look at code (which we downloaded from Cloudflare’s GitHub and haven’t done anything beside paste in our account credentials).

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