firecrawl/open-lovable · error · Error
No active sandbox
Error message
No active sandbox
What it means
VercelProvider.runCommand throws 'No active sandbox' when this.sandbox is null. The Vercel Sandbox instance is created in createSandbox(); running any command requires that live instance, so the guard aborts before parsing/executing the command.
Source
Thrown at lib/sandbox/providers/vercel-provider.ts:66
this.sandboxInfo = {
sandboxId,
url: sandboxUrl,
provider: 'vercel',
createdAt: new Date()
};
return this.sandboxInfo;
} catch (error) {
console.error('[VercelProvider] Error creating sandbox:', error);
throw error;
}
}
async runCommand(command: string): Promise<CommandResult> {
if (!this.sandbox) {
throw new Error('No active sandbox');
}
try {
// Parse command into cmd and args (matching PR syntax)
const parts = command.split(' ');
const cmd = parts[0];
const args = parts.slice(1);
// Vercel uses runCommand with cmd and args object (based on PR)
const result = await this.sandbox.runCommand({
cmd: cmd,
args: args,
cwd: '/vercel/sandbox',
env: {}
});
// Handle stdout and stderr - they might be functions in Vercel SDKView on GitHub (pinned to 69bd93bae7)
Solutions
- Await provider.createSandbox() before runCommand
- Detect Vercel sandbox expiry and recreate/reconnect before retrying the command
- Check VERCEL_TOKEN / team config so createSandbox() actually succeeds
- Single-flight createSandbox to avoid concurrent null-sandbox races
Example fix
// before
const provider = new VercelProvider();
const r = await provider.runCommand('npm run build');
// after
const provider = new VercelProvider();
await provider.createSandbox();
const r = await provider.runCommand('npm run build'); Defensive patterns
Strategy: validation
Validate before calling
if (!provider.sandbox) {
await provider.createSandbox();
}
const result = await provider.runCommand(command); Type guard
function sandboxLive(p: VercelProvider): p is VercelProvider & { sandbox: NonNullable<VercelProvider['sandbox']> } {
return p.sandbox != null;
} Try / catch
try {
await provider.runCommand(cmd);
} catch (e) {
if (e instanceof Error && e.message === 'No active sandbox') {
await provider.createSandbox();
return provider.runCommand(cmd);
}
throw e;
} Prevention
- Always await createSandbox() before the first command
- Account for Vercel Sandbox max-duration and recreate on expiry
- Verify VERCEL_TOKEN/team settings so createSandbox succeeds
- Avoid shared provider instances across concurrent requests
When it happens
Trigger: runCommand called on a fresh VercelProvider without awaiting createSandbox(); Vercel Sandbox expired (it has a max duration) leaving this.sandbox stale/null; several internal helpers (mkdirResult, writeResult, installResult, setupViteApp paths) hitting the guard when the sandbox died mid-flow.
Common situations: Vercel sandbox hit its runtime/time limit during a long build; deploy preview flow constructs the provider but skips createSandbox on a branch; command execution after an earlier step threw and cleanup nulled the sandbox.
Related errors
- No active sandbox
- Failed to write file via command: ${writeResult.stderr}
- Unsupported sandbox type
- Failed to create zip: ${error}
- Failed to read zip file: ${error}
AI-assisted analysis of firecrawl/open-lovable@69bd93bae7 (2026-08-28).
Data as JSON: /api/errors/9f03c9b6eea9a6e6.
Report an issue: GitHub.