Paste an error to match it against the wiki. / 粘贴报错后自动匹配。
Error text / 报错原文
Environment variable is not definedbinding not foundvars ignored
What it means
A variable available in local dev is not available in the Worker runtime or production build.
Most common causes
- Local .env or .dev.vars is not deployed to production
- wrangler.toml vars differ by environment
- Secret was set in dashboard but not for the selected environment
- Build-time and runtime variables are confused
Fastest fix
- Check wrangler.toml and selected environment
- Set secrets with wrangler secret put
- Restart local dev after editing .dev.vars
- Log only variable presence, not values
Safe fix
- Maintain .env.example or .dev.vars.example
- Use environment-specific config blocks
- Validate required bindings at startup
- Keep production secrets out of source control
What not to do
- Do not commit .dev.vars with real secrets
- Do not assume Vite env variables exist at Worker runtime
- Do not print secret values in logs
How to confirm the fix
Run the smallest reproducible command first, then retry the agent task only after authentication, quota, and tool discovery are stable.
wrangler --version wrangler secret list wrangler deploy --dry-run
Related errors
- Rollup failed to resolve import - Vite / Vercel deployment →
- vite: not found / tsc: not found after NODE_ENV=production in Docker →
- You've hit your session limit / weekly limit - Claude Code →
- Prompt is too long - Claude Code context window →
- Not logged in - Please run /login - Claude Code →
- API Error: Repeated 529 Overloaded errors - Claude Code →
Related tools
Sources
Based on common developer troubleshooting patterns and linked EasyTool references.