{"record":{"id":"8564dc0e21256266","repo":"firecrawl/open-lovable","slug":"restartviteserver-not-implemented-for-this-provide","errorCode":null,"errorMessage":"restartViteServer not implemented for this provider","messagePattern":"restartViteServer not implemented for this provider","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/sandbox/types.ts","lineNumber":63,"sourceCode":"  abstract runCommand(command: string): Promise<CommandResult>;\n  abstract writeFile(path: string, content: string): Promise<void>;\n  abstract readFile(path: string): Promise<string>;\n  abstract listFiles(directory?: string): Promise<string[]>;\n  abstract installPackages(packages: string[]): Promise<CommandResult>;\n  abstract getSandboxUrl(): string | null;\n  abstract getSandboxInfo(): SandboxInfo | null;\n  abstract terminate(): Promise<void>;\n  abstract isAlive(): boolean;\n  \n  // Optional methods that providers can override\n  async setupViteApp(): Promise<void> {\n    // Default implementation for setting up a Vite React app\n    throw new Error('setupViteApp not implemented for this provider');\n  }\n  \n  async restartViteServer(): Promise<void> {\n    // Default implementation for restarting Vite\n    throw new Error('restartViteServer not implemented for this provider');\n  }\n}","sourceCodeStart":45,"sourceCodeEnd":65,"githubUrl":"https://github.com/firecrawl/open-lovable/blob/69bd93bae7a9c97ef989eb70aabe6797fb3dac89/lib/sandbox/types.ts#L45-L65","documentation":"The SandboxProvider base class default restartViteServer() throws this Error to mark the capability as unsupported when a provider has not overridden it. Restarting the Vite dev server is provider-specific (process management inside the sandbox), so only providers implementing it can honor the call.","triggerScenarios":"Calling restartViteServer() on a provider subclass that did not override it, or indirectly via installPackages() when the active provider lacks the override.","commonSituations":"Switching the sandbox provider in config while the install flow unconditionally restarts Vite; a custom provider implemented only the required abstract methods; feature expects Vite hot-restart on a provider that can't manage processes that way.","solutions":["Override restartViteServer() in the active provider to kill/restart the Vite process","Gate the restart behind a capability check (e.g. 'supportsVite' flag per provider)","Skip the restart gracefully for providers without dev-server management","Switch to a provider (like VercelProvider) that implements both Vite methods"],"exampleFix":"// before\nawait provider.restartViteServer(); // throws for this provider\n// after\nif (typeof provider.restartViteServer !== SandboxProvider.prototype.restartViteServer) {\n  await provider.restartViteServer();\n} // else skip or recreate dev server another way","handlingStrategy":"validation","validationCode":"if (provider.restartViteServer === SandboxProvider.prototype.restartViteServer) {\n  console.warn('restartViteServer unsupported by provider; skipping');\n  return;\n}","typeGuard":"function supportsViteRestart(p: SandboxProvider): boolean { return p.restartViteServer !== SandboxProvider.prototype.restartViteServer; }","tryCatchPattern":"try {\n  await provider.restartViteServer();\n} catch (e) {\n  if (e.message.includes('not implemented')) { log('Skipping Vite restart: unsupported provider'); return; }\n  throw e;\n}","preventionTips":["Make Vite restart optional in the install pipeline","Document required overrides when adding providers","Prefer providers implementing both Vite methods for Vite workflows","Wrap capability-specific calls behind feature checks"],"tags":["not-implemented","provider","vite"],"backgroundTag":"method-not-implemented","analyzedSha":"69bd93bae7a9c97ef989eb70aabe6797fb3dac89","analyzedAt":"2026-08-28T22:20:32.339Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}