Issue with jurisdiction = "eu" in R2 config on wrangler.toml causing errors between

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

itemreel.com

What is the error number?

0

What is the error message?

What is the issue or error you’re encountering

Issue with jurisdiction = “eu” in R2 config on wrangler.toml causing errors between npm run dev and npm run deploy

What are the steps to reproduce the issue?

Hi all,

I’m encountering an issue with my Cloudflare Worker’s R2 configuration in the wrangler.toml file. Here’s my current setup:

r2_buckets = [
  { binding = "BUCKET_BINDING", bucket_name = "my-bucket-name", preview_bucket_name = "my-preview-bucket-name", jurisdiction = "eu"},
]

When I run npm run deploy (which runs “wrangler deploy --minify src/index.js”), everything works fine, and the worker deploys without any problems.

However, when I run npm run dev (which runs “wrangler dev src/index.js --remote”), I get the following error:

✘ [ERROR] Error on remote worker: APIError: A request to the Cloudflare API (/accounts/ece6cdd83c5ad5484c6a5afcb6deeb0a/workers/scripts/itemreel-api/edge-preview) failed.

If I remove the jurisdiction = “eu” part from the R2 bucket config, npm run dev works perfectly, and I can access the remote D1 databases and buckets. However, this then causes an error when I try to deploy, returning:

workers.api.error.bucket_not_found [code: 10085]

At the moment, I’m manually adding or removing the jurisdiction = “eu” line depending on whether I’m deploying or running the dev environment, which is not ideal.

Is there a way to resolve this issue so I don’t have to modify the wrangler.toml every time I switch between dev and deploy commands?

Any advice or suggestions would be much appreciated!

Thanks!