linshenkx/prompt-optimizer · critical · Error

Desktop remote storage IPC is unavailable

Error message

Desktop remote storage IPC is unavailable

What it means

DesktopIpcRemoteObjectStore routes all operations through window.electronAPI.remoteStorage; if that preload bridge is missing it throws. This happens when web code runs outside the Electron desktop shell but the runtime flag says 'desktop'.

Source

Thrown at packages/ui/src/utils/remote-backup.ts:1535

  async getText(path: string): Promise<string> {
    return this.invoke<string>('getText', { path })
  }

  async list(prefix: string): Promise<RemoteObjectEntry[]> {
    return this.invoke<RemoteObjectEntry[]>('list', { path: prefix })
  }

  async delete(path: string): Promise<void> {
    await this.invoke<null>('delete', { path })
  }

  private async invoke<T>(
    operation: RemoteStorageIpcOperation,
    input: Omit<RemoteStorageIpcRequest, 'provider' | 'operation'>,
  ): Promise<T> {
    const api = typeof window !== 'undefined' ? window.electronAPI?.remoteStorage : undefined
    if (!api) {
      throw new Error('Desktop remote storage IPC is unavailable')
    }
    return api.invoke<T>({
      provider: cloneRemoteBackupProviderConfig(this.config),
      operation,
      ...input,
    })
  }
}

class S3CompatibleRemoteObjectStore extends BaseRemoteObjectStore {
  provider: RemoteBackupProviderKind = 's3-compatible'
  private readonly client: S3Client

  constructor(private readonly config: Extract<RemoteBackupProviderConfig, { kind: 's3-compatible' }>) {
    super()
    this.assertConfigured()
    this.client = new S3Client({
      endpoint: config.endpoint,

View on GitHub (pinned to 3e677b1d9f)

Solutions

  1. Ensure the app actually runs inside the matching Electron desktop build (update the desktop app)
  2. Verify the preload script exposes remoteStorage on window.electronAPI
  3. Don't force runtime='desktop' when running in a browser — pass 'web'

Example fix

// before
const store = createRemoteObjectStore(cfg, 'desktop')
// after
const runtime = window.electronAPI ? 'desktop' : 'web'
const store = createRemoteObjectStore(cfg, runtime)
Defensive patterns

Strategy: validation

Validate before calling

const runtime = typeof window !== 'undefined' && window.electronAPI?.remoteStorage ? 'desktop' : 'web'

Type guard

const hasRemoteStorageIpc = (): boolean => Boolean((window as any)?.electronAPI?.remoteStorage)

Try / catch

catch (e) { if ((e as Error).message.includes('IPC is unavailable')) promptAppUpdate(); else throw e }

Prevention

When it happens

Trigger: runtime === 'desktop' passed to createRemoteObjectStore while window.electronAPI?.remoteStorage is undefined — running the UI in a plain browser, an outdated desktop build without the remoteStorage preload, or the preload script failed to inject.

Common situations: Opening the web bundle with a stale 'desktop' runtime flag; upgrading the web package without upgrading the Electron shell; preload script error suppressing electronAPI.

Related errors


AI-assisted analysis of linshenkx/prompt-optimizer@3e677b1d9f (2026-08-27). Data as JSON: /api/errors/1911ac0f021b780f. Report an issue: GitHub.