workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🐛 BUG: `__STATIC_CONTENT_MANIFEST` is not defined

Open CMCDragonkai opened this issue 3 years ago • 1 comments

What version of Wrangler are you using?

2.0.23

What operating system are you using?

Linux

Describe the Bug

I'm attempting to use ES-module style with @cloudflare/kv-asset-handler. The README.md says to use __STATIC_CONTENT_MANIFEST. However this variable does not exist.

When attempting to deploy it says:

✘ [ERROR] A request to the Cloudflare API (/accounts/5e0333335a21846798fafca9e55e044f/workers/scripts/polykey-docs-dev) failed.

  Uncaught ReferenceError: __STATIC_CONTENT_MANIFEST is not defined
    at line 0
   [code: 10021]

Also I was using TS, what is the right way to make TS believe that this string exists?

CMCDragonkai avatar Jul 28 '22 15:07 CMCDragonkai

could you make a small standalone repo that reproduces this problem? we'd be happy to investigate

threepointone avatar Jul 28 '22 15:07 threepointone

Closing this, as there's not enough detail to reproduce. This seems like the flavour of issue that comes up when the right section isn't set up in wrangler.toml:

[site]
bucket = "./your-asset-folder-path"

There's also a demo of how to use this on the @cloudflare/kv-asset-handler repo.

penalosa avatar Sep 21 '22 15:09 penalosa