firecrawl/open-lovable · error · Error

setupViteApp not implemented for this provider

Error message

setupViteApp not implemented for this provider

What it means

The abstract SandboxProvider base class (lib/sandbox/types.ts) provides a default setupViteApp() that throws this Error. Providers that have not overridden it cannot scaffold a Vite app, so calling the base implementation fails fast to signal the capability is unsupported for that provider.

Source

Thrown at lib/sandbox/types.ts:58

  constructor(config: SandboxProviderConfig) {
    this.config = config;
  }

  abstract createSandbox(): Promise<SandboxInfo>;
  abstract runCommand(command: string): Promise<CommandResult>;
  abstract writeFile(path: string, content: string): Promise<void>;
  abstract readFile(path: string): Promise<string>;
  abstract listFiles(directory?: string): Promise<string[]>;
  abstract installPackages(packages: string[]): Promise<CommandResult>;
  abstract getSandboxUrl(): string | null;
  abstract getSandboxInfo(): SandboxInfo | null;
  abstract terminate(): Promise<void>;
  abstract isAlive(): boolean;
  
  // Optional methods that providers can override
  async setupViteApp(): Promise<void> {
    // Default implementation for setting up a Vite React app
    throw new Error('setupViteApp not implemented for this provider');
  }
  
  async restartViteServer(): Promise<void> {
    // Default implementation for restarting Vite
    throw new Error('restartViteServer not implemented for this provider');
  }
}

View on GitHub (pinned to 69bd93bae7)

Solutions

  1. Implement setupViteApp() in the active provider class (copy the VercelProvider approach)
  2. Or route scaffold calls only to providers that support it (capability check before calling)
  3. Or replace the throw in the base class with a no-op/default scaffold if all runtimes can support it
  4. Verify which provider is configured and switch to one supporting Vite scaffolding

Example fix

// before
class MyProvider extends SandboxProvider { /* no setupViteApp */ }
// after
class MyProvider extends SandboxProvider {
  async setupViteApp(): Promise<void> {
    await this.runCommand('mkdir -p src');
    // scaffold Vite app...
  }
}
Defensive patterns

Strategy: validation

Validate before calling

if (provider.setupViteApp === SandboxProvider.prototype.setupViteApp) {
  throw new Error(`Provider ${providerName} does not support Vite scaffolding`);
}

Type guard

function supportsViteSetup(p: SandboxProvider): boolean { return p.setupViteApp !== SandboxProvider.prototype.setupViteApp; }

Try / catch

try {
  await provider.setupViteApp();
} catch (e) {
  if (e.message.includes('not implemented')) { fallbackToManualScaffold(provider); return; }
  throw e;
}

Prevention

When it happens

Trigger: Calling setupViteApp() on a provider subclass (other than VercelProvider) that did not override setupViteApp — e.g. a minimal E2B or custom provider. Switching providers via config while the UI unconditionally calls setupViteApp after creation.

Common situations: Config points at a provider like 'e2b' or a stub/local provider that only implements create/read/run; a feature flag switches providers but the scaffold step is unconditional; a newly added provider missing the optional override.

Related errors


AI-assisted analysis of firecrawl/open-lovable@69bd93bae7 (2026-08-28). Data as JSON: /api/errors/24b642818a42b700. Report an issue: GitHub.