AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Edge Functions Deploy 400: Bundle Generation Timed Out For Large Monolithic Functions

Deploying an Edge Function via the Supabase Dashboard/API fails with HTTP 400 'Bundle generation timed out' for a single ~9176-line index.tsx entrypoint. The server-side bundler enforces a fixed timeout that is exceeded by large monolithic files, and no actionable phase or size details are returned.

highConfidence 75%Supabase Edge Functions

Origin Analysis

The Edge Functions platform uses a server-side bundler with a hard timeout during bundle generation. A monolithic ~9176-line entry file with a non-trivial import graph exceeds that timeout, triggering a generic 400 error. The timeout may have been reduced by recent platform changes or increased remote import latency, causing a regression from the previous month.
1. Create or update an Edge Function slug 'smart-action' with a monolithic index.tsx of ~9000+ lines and typical app/server imports. 2. Deploy via Supabase Dashboard or POST /v1/projects/<PROJECT_REF>/functions/deploy?slug=smart-action. 3. Observe HTTP 400 response with body {"message":"Bundle generation timed out"}.

Fixing Code Block

Edge Case Audit

Increasing the timeout globally may delay error responses and occupy bundler workers for longer, especially under concurrent deploys. Very large bundles can still exhaust memory or hit other platform limits; a per-project or per-function limit is preferable. Deploy this behind an env var and monitor resource usage. Rollback by removing EDGE_FUNCTION_BUNDLE_TIMEOUT_MS and reverting the code. Also recommend users split monolithic functions or use local CLI bundling to avoid server-side timeouts.

Ecosystem Topology