Skip to content
Latchkey

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.js

How to prevent it

  • Always commit a main key so deploys are deterministic.
  • Make sure the build runs before deploy so the entry file exists.
  • Keep main aligned with your build output directory.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →