Experimental_serve_directly for static assets not working

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

buildwithjig.com

What is the issue or error you’re encountering

I have a static assets worker with experimental_serve_directly = false, but it is serving the assets directly first. I have tried run_worker_first = true but that doesn’t work either.

What steps have you taken to resolve the issue?

  • tried run_worker_first = true with latest compatibility date

You should use run_worker_first as the other one is deprecated.

Just to check – the setting needs to be under assets and not at the top level:

  "assets": {
    "directory": "./public/",
    "binding": "ASSETS",
    "run_worker_first": true
  }

Is that how you have it?

Yes I tried:

compatibility_date = "2025-01-30"
compatibility_flags = ["nodejs_compat"]
assets = { directory = "./react-admin/build", binding = "ASSETS", run_worker_first = true }

not sure if the compatibility date should be more recent? Neither this nor experimental_serve_directly is getting the worker to run before the static assets