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.
✘ [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
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.
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.