Why your base44 sandbox keeps timing out
To fix base44 sandbox timeout error, shrink each prompt to a single bounded change, pin the file paths the agent is allowed to touch, and split the work across multiple short generations instead of one mega-prompt. The sandbox runs each generation inside a per-prompt execution budget that Base44 does not publish, and that budget covers planning, file reads, dependency resolution, code emission, and the type-check pass — not just the visible response. Four causes push a prompt past that budget: prompts that span too many files, unresolved npm dependencies that block resolution, agent context bloat from large pasted snippets, and a stuck preview iframe holding the sandbox open. The fix is procedural, not platform-side: tighter prompts, explicit file scopes, and a sandbox restart after every timeout.
You typed a prompt asking Base44 to refactor a checkout flow, add Stripe webhooks, and update the order schema. The agent thought for a long time. The preview iframe went blank. A toast appeared with "sandbox timed out" or "generation failed" and your credit balance went down. You hit retry. Same result. You retry one more time and the third attempt actually succeeds, but you cannot tell whether anything changed because the preview will not render and the sandbox refuses to wake up.
This is the most expensive failure mode on Base44 outside of a full deployment crash. Credits are billed against the work the sandbox tried to do, not the work it shipped. A team that times out three prompts in a row has paid for three full generations and gotten zero code in return. The prompt is the wrong shape for the sandbox budget, the user is unaware there is a budget at all, and the platform's UI surfaces the timeout as if it were a transient error instead of a signal to rewrite the prompt.
The Base44 docs do not publish the sandbox timeout number, and the effective budget is not constant. It shifts with sandbox warm state, project size, and whether the agent has to resolve new npm packages on the same prompt. None of those factors are documented, so users have to learn the budget through expensive failed prompts.
What causes base44 sandbox timeouts
The sandbox is a containerized environment that runs four phases on every prompt: project tree walk, dependency resolution, agent planning + code emission, and a type-check pass. The whole sequence has to finish inside one budget window. When any phase stalls, the whole prompt dies. Four root causes can push a prompt past that window.
Prompts that span too many files. The agent has to plan changes against every file the prompt references before emitting a single line of code. The more files a prompt names, the longer planning runs before any code is emitted. Add the code emission and type-check phases on top and a multi-file prompt can run past the budget.
Unresolved npm dependencies. When the prompt asks the agent to install or use a new package, the sandbox has to resolve the dependency graph before the agent can emit import statements. A clean install of a heavy package like puppeteer, sharp, or one of the AI SDKs adds significant time on a cold sandbox. If the package conflicts with an existing dependency, resolution can stall indefinitely and the sandbox times out without ever reaching the agent phase. This is documented behavior on the Base44 feedback board under threads about "unsupported dependency" errors.
Agent context bloat. The agent re-reads the recent conversation as context on every prompt. Pasted file contents, big JSON dumps, raw error logs, and long stack traces all count against the context budget. A large pasted blob adds context processing before planning even starts. Replacing pasted blobs with file references is a cheap, reliable gain — the agent loads from the file system instead of re-tokenizing chat history.
Stuck preview iframes. Less common but real. The preview iframe sometimes holds an open WebSocket to the sandbox container after a prior failed prompt. The container counts that as active and refuses to recycle, which means the next prompt runs in a sandbox that is already partially in a bad state. The symptom is a sandbox that times out instantly with no planning phase visible at all. The fix is a hard restart from the project menu, not a page refresh.
How to confirm you have a sandbox timeout (reproduction)
- Open the project in Base44 and open browser DevTools, Network tab, filter by Fetch/XHR.
- Issue the prompt that you suspect is too large. Watch the network panel for the long-lived request to the sandbox API (typically a POST to
/api/generateor/api/agent/rundepending on the project). - Note the elapsed time when the request fails. A response that returns quickly with an error is not a sandbox timeout — that is a different failure (often a code-emission error or a dependency conflict). A request that hangs for a long time and then dies with a 504, a CORS-style cancel, or no response at all is the sandbox timeout signature.
- Open the Console tab. Look for messages from the sandbox runtime — "sandbox terminated", "execution budget exceeded", or a generic "generation failed". These confirm the timeout was server-side, not a client-side abort.
- Check the credit ledger after the failed prompt. A real sandbox timeout deducts credits for compute consumed up to the failure point. If credits did not change, the request was rejected before the sandbox started and you are dealing with a different problem.
- Refresh the preview. If the iframe is blank, gray, or shows a stale version of the app from before the prompt, the sandbox is in a stuck state and needs a restart before any retry.
How to fix base44 sandbox timeout — step-by-step
The fix is procedural. There is no platform setting to extend the budget and no flag to expose more diagnostics. The working fix has a three-part shape.
Step 1: Restart the sandbox and capture a clean baseline
Restart the sandbox from the project menu before doing anything else. Wait for the preview iframe to render the current state of the app fully. Open the browser console and confirm there are no lingering errors from the prior failed prompt. Then issue a tiny, known-safe prompt — something like "update the page title in src/pages/Home.tsx to 'Hello'" — and verify it completes quickly and cleanly.
This baseline is non-negotiable. Without it you cannot tell whether the next change worked or whether you happened to land on a warmer sandbox. The Lowcode Agency debugging guide for Base44 makes the same point: never debug a timeout on top of an unverified sandbox state.
// Example of a minimal, verifiable warm-up prompt:
// "Set the document title in src/pages/Home.tsx to 'Hello world'."
//
// What you should see:
// - Network request completes quickly, well short of a timeout
// - Preview re-renders with the new title visible in the tab
// - No console errors, no warning banners
Step 2: Rewrite the failing prompt into bounded slices
Take the prompt that timed out and split it into a sequence of two or three smaller prompts. Each slice should touch at most two files and address one architectural concern. Name the exact file paths in every slice — do not let the agent infer scope.
For example, suppose this is the original prompt that timed out:
Add Stripe webhook handling for subscription events, update the user
schema to track subscription status, refactor the billing page to
show the current plan, and add an admin view for managing subscriptions.
A rewritten sequence splits it into bounded slices:
// Prompt 1:
// "In src/api/webhooks/stripe.ts, add a handler for the
// customer.subscription.updated event that updates the user's
// subscriptionStatus field. Do not modify any other files."
// Prompt 2:
// "In src/db/schema.ts and src/types/user.ts, add a subscriptionStatus
// field of type 'active' | 'cancelled' | 'past_due'. Do not modify
// any other files."
// Prompt 3:
// "In src/pages/Billing.tsx, render the current plan name and
// subscriptionStatus from the user record. Do not modify any other files."
Each slice names its files and addresses one concern, so each runs in its own budget window. Total wall-clock time across the slices can exceed a single prompt, but no slice carries the full planning load of the mega-prompt, and you stop paying for retries of a prompt that cannot fit.
Step 3: Strip context bloat and pin file paths
Inside each slice, do two things to keep the prompt under the budget.
First, remove every pasted blob from the recent conversation. If the conversation contains a long stack trace, a full file you pasted earlier, or a JSON dump from a debugging session, clear them. Replace any future paste with a file reference. The agent reads files from the project tree faster than it re-tokenizes chat history.
Second, end every prompt with an explicit scope sentence:
Only modify <file-path-1> and <file-path-2>. Do not read or change any other files.
This single sentence shortens planning because the agent skips the project-tree walk on files outside the scope. On a large project, that reduction alone can be enough to clear the budget.
// Anti-pattern (causes timeout):
// "Refactor the checkout. Make sure it works with Stripe.
// Use the existing utilities. Add tests."
//
// Fixed pattern:
// "In src/pages/Checkout.tsx, replace the inline Stripe Elements
// setup with a call to the existing createPaymentIntent() helper
// in src/lib/stripe.ts. Only modify src/pages/Checkout.tsx.
// Do not read or change any other files."
The fixed pattern is verbose on purpose. Verbosity in the scope contract buys silence elsewhere — the agent plans against a smaller surface, emits faster, and the prompt clears.
How long does it take to fix base44 sandbox timeout?
The procedural fix is a 30-minute job. The timeline breaks down like this:
- Sandbox restart and clean baseline: 3-5 minutes. Mostly waiting for the preview to render and confirming the project is in a known-good state.
- Prompt split and rewrite: 10-15 minutes. The actual work of decomposing one large prompt into two or three small ones, with explicit scopes on each.
- Re-running the split sequence: 5-10 minutes. Each slice is a short generation, plus a few seconds to verify the preview reflects the change before moving to the next slice.
- Documenting the rule for the project: 5 minutes. Adding a
/docs/ai-prompting.mdnote or a README line capturing the prompt-size limit so future contributors do not relearn the budget.
If prompts keep timing out after the split and the project itself is too heavy — for example, a single project that has grown past 100 files and four installed integrations — the timeline extends to 2-4 hours because the project also needs trimming. Delete dead routes, archive unused features, remove unused npm dependencies, and consider moving stable surfaces off the AI editor to a separate Next.js or Vite project. We document the broader decoupling pattern at /fix/vendor-lock-in-sdk-dependency.
In the worst cases — projects that time out on more than half of all prompts regardless of prompt size — the right move is a partial migration rather than continued tuning. The sandbox budget is fixed by the platform and a heavy project will keep losing prompts forever.
DIY vs hire decision
DIY this if: The timeout is recent (last few days), the project is under 80 files, and the failing prompt was clearly too large. The three-step fix above takes 30 minutes and requires no platform-side intervention.
Hire help if: Timeouts have persisted for two or more weeks, the project is over 100 files, multiple team members are losing credits to the same prompt patterns, or the timeout pattern coincides with a deployment crash. At that point the issue is no longer a single prompt — it is project shape, dependency bloat, and team discipline around prompting, all of which need an outside audit and a documented prompt-style guide before the bleeding stops.
Need this fixed before your next deploy?
Our fix-sprint engagement diagnoses the timeout pattern across your last 20-30 prompts, identifies which prompt shapes are blowing the budget, ships a project-specific prompt-style guide, trims dead dependencies, and pairs with your team for two days to verify the new shape holds. You come out the other side with a documented rule set built to prevent recurrence.
Start a fix-sprint engagement for sandbox timeouts
Related problems
- Base44 function timeout error — the runtime sibling of this problem, for backend functions that time out at request time rather than at generation time.
- Context window exceeded — AI forgets — closely related: the same context bloat that causes sandbox timeouts also causes the agent to drop earlier instructions mid-session.
- Excessive credit burn on minor changes — the financial pattern that repeated sandbox timeouts produce. Every failed prompt is billed, so a timeout incident is also a credit-burn incident.