references/pages-functions/gotchas.md
Pages Functions Troubleshooting
Start with the request path, deployment environment, and generated output that actually handled the request.
| Task | Documentation | | --- | --- | | A Function does not run or receives unexpected parameters | Routing | | Middleware is skipped or static fallback fails | Advanced mode | | Middleware order or scope is incorrect | Middleware | | Bindings or secrets differ between environments | Bindings | | Runtime or environment types do not match | TypeScript | | A local request behaves differently | Local development | | Inspect exceptions and deployment logs | Debugging and logging | | Check runtime quotas | Workers limits | | Check request costs | Functions pricing |
Reproduce a failing path through the actual application rather than only calling a handler with a hand-built context. Check the deployed configuration and generated output before changing application code. See Pages troubleshooting for build, asset, and framework issues.