Your configuration file is missing compatibility_date..."2021-10-18"

FYI: Error message after running

https://github.com/lappalj4/cloudflare-worker-cra/generate

Your configuration file is missing compatibility_date, so a distant past date is assumed. To get the latest possibly-breaking bug fixes, add this line to your wrangler.toml:

compatibility_date = "2021-10-18"

For more information about compatibility dates, see: https://developers.cloudflare.com/workers/platform/compatibility-dates

The wrangler.toml file in https://github.com/lappalj4/cloudflare-worker-cra doesn’t have a compatibility_date set so that error is to be expected.

It would be good to update the instructions on GitHub - juiceo/cloudflare-worker-cra: A fresh CRA project which automatically deploys to Cloudflare Workers with Github Actions. .

After adding the line to the wrangler.toml, the build still fails.

Error: unknown field compatibility_date, expected one of bucket, entry-point, include, exclude

My wrangler.toml file looks like this:

name = “my-worker”
type = “webpack”
workers_dev = true
route = “”
zone_id = “”

[site]
bucket = “./build”
entry-point = “workers-site”
compatibility_date = “2021-10-18”

Try moving the compatibility date above [sites]

I suggest you create a pull request if you want it fixed - that repo isn’t maintained by Cloudflare.

It shouldn’t be specified in the [site] section - try this instead:

compatibility_date = "2021-10-18"
name = "my-worker"
type = "webpack"
workers_dev = true

[site]
bucket = "./build"
entry-point = "workers-site"

Furthermore, you can deploy the Worker just fine without specifying a compatibility_date in wrangler.toml as Wrangler will just, at least for the time being, assume a distant past date. It is, however, recommended to specify a compatibility_date as you’ll otherwise miss out on the latest fixes.

2 Likes

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