wrangler deploy “Missing entry-point”: Deploy a Static dist Directory
When wrangler deploy stops with Missing entry-point, Wrangler cannot tell what should be deployed. It found a configuration or command without a Worker main entry and without a usable static assets directory.
For a static build that already produces dist/, the narrow fix is:
pnpm buildpnpm exec wrangler deploy --assets ./distFor a Worker, declare its script instead:
pnpm exec wrangler deploy src/index.tsThe better long-term choice is to put the deployment model in wrangler.jsonc, so local commands and CI use the same source of truth.
First decide: Worker code, static assets, or both
Wrangler supports three different shapes that are easy to mix up:
| Deployment shape | What Wrangler needs | Typical configuration |
|---|---|---|
| Worker only | A module entry point | main: "src/index.ts" |
| Static assets only | A directory containing the built files | assets.directory: "./dist" |
| Worker plus assets | Both the Worker entry and the asset directory | main plus assets.directory |
The Workers command reference accepts a Worker entry point or a static assets directory. The Static Assets guide shows assets.directory as the place to declare the folder that Wrangler uploads.
This is a deployment-boundary error, not an Astro routing error. Count and inspect the output before changing routes:
pnpm buildtest -d distfind dist -type f | head -20If the build writes build/, out/, or another directory, replace ./dist with that real output path. A correct command pointed at an empty or non-existent directory still cannot deploy the site you built.
Put a static Astro build in wrangler.jsonc
For a static-only deployment, use a configuration like this:
{ "$schema": "./node_modules/wrangler/config-schema.json", "name": "my-static-site", "compatibility_date": "2026-08-19", "assets": { "directory": "./dist" }}Run the build before deployment:
pnpm buildpnpm exec wrangler deployIf the project has a Worker that handles API routes or request-time rendering, add its entry point rather than removing the code that needs to run:
{ "$schema": "./node_modules/wrangler/config-schema.json", "name": "my-worker-site", "main": "src/index.ts", "compatibility_date": "2026-08-19", "assets": { "directory": "./dist" }}Do not copy a pages_build_output_dir setting from a Cloudflare Pages project into a Workers Static Assets configuration. The Cloudflare Pages file-limit guide explains the product distinction and the separate migration decision. assets.directory is the Workers configuration boundary.
Diagnose CI-specific missing entry points
The same repository can work locally and fail in CI when the build runs in one directory while Wrangler looks for configuration in another. Log the inputs that determine the deployment:
pwdpnpm exec wrangler --versiontest -f wrangler.jsonc && sed -n '1,160p' wrangler.jsoncpnpm buildfind dist -maxdepth 2 -type f | head -20pnpm exec wrangler deployCheck these boundaries in order:
- The job is running from the package that owns the Wrangler config.
- The build command completed before
wrangler deploystarted. - The configured asset directory exists in the CI filesystem.
- The CI checkout includes the configuration and generated output.
- The deployed project uses the same config variant and environment as the local command.
If the configuration is generated or stored outside the working directory, pass the intended config explicitly using the Wrangler option supported by the installed CLI rather than relying on the current directory. Keep the final command in CI visible enough that a missing path is diagnosable from the log.
Cloudflare’s build troubleshooting guide describes the same missing-entry-point failure and points to the project root and configuration file as first checks. The Workers SDK issue #10563 is useful as a symptom reference, but your project’s actual output path remains the decisive evidence.
Verify the deployed shape
After the command succeeds, test one request for each kind of output:
- an HTML page generated into
dist/; - a CSS or JavaScript asset;
- a missing URL that should return the intended 404 behavior;
- a Worker route, if
mainis configured; - an API or binding-backed route, if the site is not purely static.
Do not infer SSR support from a successful asset upload. A static asset deployment can serve a polished site while still lacking request-time sessions, bindings, or API execution. The existing Astro Cloudflare session binding guide covers the separate case where an Astro Worker needs a KV binding.
The practical fix is to make the deployment shape explicit. Give Wrangler a Worker entry when code must execute, give it the directory that actually contains the static build when it does not, and keep the same configuration visible to local commands and CI.
FAQ
Q: Can I deploy a static dist/ folder without a Worker entry point?
A: Yes. Configure assets.directory or pass --assets ./dist to wrangler deploy. A Worker main is needed only when Worker code must execute alongside the assets.
Q: Why does wrangler deploy work locally but fail in CI?
A: CI may run from a different root, omit wrangler.jsonc, build to a different directory, or start deployment before the build finishes. Print the working directory, config, Wrangler version, and generated output in the failing job.
Q: Is pages_build_output_dir the same as assets.directory?
A: No. pages_build_output_dir belongs to Cloudflare Pages configuration. Workers Static Assets uses assets.directory; moving between products requires an intentional migration and route check.
References:
Cloudflare Workers Wrangler commands
Cloudflare Workers Static Assets
Report a typo or broken link, or suggest a related topic.