-
Notifications
You must be signed in to change notification settings - Fork 985
Description
What
On wrangler deploy
or wrangler versions upload
, if there is no wrangler.jsonc
file:
Wrangler should attempt to detect what it thinks the static assets directory is (look at framework, config, etc.)
Start small and simple to start — ex: look for /dist directory, have a map of framework to output dir.
Start simple and small — put this suggestion in Wrangler's output.
Why
If you run wrangler deploy
in a project that only has static assets, you get:
15:50:02.949 | ✘ [ERROR] Missing entry-point to Worker script or to assets directory
15:50:02.950 | If there is code to deploy, you can either:
15:50:02.950 | - Specify an entry-point to your Worker script via the command line (ex: `npx wrangler deploy src/index.ts`)
15:50:02.950 | - Or create a "wrangler.jsonc" file containing:
15:50:02.951 | {
15:50:02.951 | "name": "worker-name",
15:50:02.951 | "compatibility_date": "2025-09-05",
15:50:02.951 | "main": "src/index.ts"
15:50:02.951 | }
There is no reason why anyone getting started with Cloudflare will understand what to do here.
And even if they do it — it won't actually solve their problem.
We need to guide people to the right answer, and we can use the fact that we can see the directory someone runs wrangler in, to get signal on what they are trying to do and suggest what to do instead.
Example copy, please improve:
"You ran wrangler deploy
, and this failed to deploy a Worker. We noticed that there is a directory called /dist
in your project. If you are trying to deploy the contents of that directory to Cloudflare, please instead run wrangler deploy --assets ./dist
"
Metadata
Metadata
Assignees
Labels
Type
Projects
Status