Cannot access Workers Secrets in Workers type="webpack"

I’m trying to publish my workers that uses secrets but it raise an error, it turns out that somehow secrets works with plain javascript but not with workers that bundled with webpack.

I manage to reproduce the issue in this repository.

Step by step to reproduce:

git clone
cd with-webpack/

Rename the wrangler.toml.example to wrangler.toml and update YOUR_ACCOUNT_ID and YOUR_ZONE_ID .

Create the secret using the following command:

wrangler secret put MY_SECRET

Then publish the worker:

wrangler publish

Access .

You should see an error.

Where project without webpack runs fine.

Am I missing something here?

Ehhh… it’s strange. I don’t do anything, but now workers bundled with webpack is working. Seems the error only happen in 1-3 minutes after publishing :thinking: