hcengineering/platform · error

unsupported

Error message

unsupported

What it means

This is a stub/placeholder storage adapter method: loadChunk on the no-op adapter explicitly throws Error('unsupported') to signal that chunked loading is not implemented for this adapter.

Source

Thrown at foundations/server/packages/core/src/utils.ts:378

      return (await storageAdapter.findAll(ctx, _class, query, options)) as any
    }

    async domainRequest<T>(domain: OperationDomain, params: DomainParams): Promise<DomainResult<T>> {
      return { domain, value: null as any }
    }

    async tx (tx: Tx): Promise<TxResult> {
      return await storageAdapter.tx(ctx, tx)
    }

    async searchFulltext (): Promise<SearchResult> {
      return { docs: [] }
    }

    async close (): Promise<void> {}

    async loadChunk (domain: Domain): Promise<DocChunk> {
      throw new Error('unsupported')
    }

    async getDomainHash (domain: Domain): Promise<string> {
      return await storageAdapter.getDomainHash(ctx, domain)
    }

    async closeChunk (idx: number): Promise<void> {}

    async loadDocs (domain: Domain, docs: Ref<Doc>[]): Promise<Doc[]> {
      return []
    }

    async upload (domain: Domain, docs: Doc[]): Promise<void> {}

    async clean (domain: Domain, docs: Ref<Doc>[]): Promise<void> {}

    async loadModel (): Promise<Tx[]> {
      return txes

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Use a real storage-backed storage adapter instead of the stub
  2. Avoid calling loadChunk paths (e.g. data export) on the dummy adapter
  3. If writing tests, mock loadChunk or skip chunked-loading code paths
Defensive patterns

Strategy: type-guard

Type guard

function supportsLoadChunk(a: StorageAdapter): a is StorageAdapter & { loadChunk: NonNullable<StorageAdapter['loadChunk']> } {
  return typeof (a as any).loadChunk === 'function' && !(a instanceof DummyStorageAdapter)
}

Try / catch

try {
  const chunk = await adapter.loadChunk(domain)
} catch (err) {
  if (err instanceof Error && err.message === 'unsupported') {
    // skip chunked path or swap in a real storage adapter
  } else throw err
}

Prevention

When it happens

Trigger: Calling loadChunk (via a wrapped pipeline client) when the pipeline was constructed with the dummy/empty storage adapter rather than a real storage-backed adapter.

Common situations: Using a dry-run or in-memory pipeline mode that intentionally lacks loadChunk; invoking backup/migration operations against an empty adapter; unit tests using the stub and accidentally exercising loadChunk.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/a1efb50e91fb188b. Report an issue: GitHub.