Wrangler "Missing entry-point" / main not set in CI
Wrangler does not know which file to bundle as the Worker. Set main in wrangler.toml (or pass the file as an argument) so the deploy has an entry point.
What this error means
A wrangler deploy step fails with "Missing entry-point: Points to the file that will be executed in the Worker" before any bundling happens.
wrangler
✘ [ERROR] Missing entry-point: Points to the file that will be executed in the Worker.
You can set this in your wrangler.toml with the `main` key, or pass it as an argument.Common causes
No main key in wrangler.toml
Without main, Wrangler cannot infer the source file, especially in CI where there is no interactive prompt.
A build step outputs elsewhere than main points
If a framework builds to dist/ but main points at src/, the entry file may not exist at deploy time.
How to fix it
Set main in wrangler.toml
wrangler.toml
name = "app"
main = "src/index.ts"
compatibility_date = "2024-09-23"Pass the entry file explicitly
When the build output path is dynamic, hand the file to deploy directly.
Terminal
npx wrangler deploy dist/worker.jsHow to prevent it
- Always commit a
mainkey so deploys are deterministic. - Make sure the build runs before deploy so the entry file exists.
- Keep
mainaligned with your build output directory.
Related guides
Wrangler Workers "Deploy failed" in CIFix Wrangler Workers "Deploy failed" in CI - the upload was rejected by Cloudflare. Read the line above the s…
Wrangler esbuild "Build failed" in CIFix Wrangler "Build failed with N errors" (esbuild) in CI - Wrangler bundles the Worker with esbuild and a sy…
Wrangler "compatibility_date" required / missing in CIFix Wrangler "A compatibility_date is required when publishing" in CI - add a compatibility_date to wrangler.…