transloadit/uppy · warning · Error

call to thumbnail is not implemented

Error message

call to thumbnail is not implemented

What it means

OneDrive's Companion provider deliberately does not implement thumbnail(): OneDrive/SharePoint expose public thumbnail URLs via the drives/items/{id}/thumbnails API, so proxying image bytes through Companion is unnecessary. Calling thumbnail() throws immediately after logging 'provider.onedrive.thumbnail.error'.

Source

Thrown at packages/@uppy/companion/src/server/provider/onedrive/index.ts:132

          `${getRootPath(queryRecord)}/items/${id}/content`,
          { responseType: 'json' },
        )
        const { size } = await prepareStream(stream)
        return { stream, size }
      },
    )
  }

  override async thumbnail(): Promise<{
    stream: Readable
    contentType: string
  }> {
    // not implementing this because a public thumbnail from onedrive will be used instead
    logger.error(
      'call to thumbnail is not implemented',
      'provider.onedrive.thumbnail.error',
    )
    throw new Error('call to thumbnail is not implemented')
  }

  override async size({
    id,
    query,
    providerUserSession: { accessToken: token },
  }: {
    id: string
    query: Query
    providerUserSession: OneDriveUserSession
  }): Promise<number | undefined> {
    return this.#withErrorHandling('provider.onedrive.size.error', async () => {
      const queryRecord = getQueryRecord(query)
      const body = await getClient({ token })
        .get(`${getRootPath(queryRecord)}/items/${id}`, {
          responseType: 'json',
        })
        .json<Record<string, unknown>>()

View on GitHub (pinned to 5d4dedd02a)

Solutions

  1. Use the thumbnail URLs already returned by OneDrive's list() results instead of calling thumbnail()
  2. Gate thumbnail() calls on provider capability
  3. Catch this error and fall back to the item's public thumbnail link

Example fix

// before
const { stream } = await provider.thumbnail({ id, providerUserSession })

// after
if (provider.id === 'onedrive') {
  return item.thumbnail // public URL from list()
}
const { stream } = await provider.thumbnail({ id, providerUserSession })
Defensive patterns

Strategy: validation

Validate before calling

const THUMBNAILLESS_PROVIDERS = new Set(['onedrive', 'facebook'])
if (!THUMBNAILLESS_PROVIDERS.has(providerId)) {
  const { stream } = await provider.thumbnail({ id, providerUserSession })
}

Type guard

const supportsThumbnail = (p: { id: string }): boolean => p.id !== 'onedrive' && p.id !== 'facebook'

Try / catch

try { await provider.thumbnail(args) } catch (e) { if (e instanceof Error && e.message === 'call to thumbnail is not implemented') { return item.thumbnail } throw e }

Prevention

When it happens

Trigger: Invoking the generic thumbnail route or provider.thumbnail() while the provider is 'onedrive'; generic code that assumes every provider implements the full Provider interface.

Common situations: Building provider-agnostic thumbnail logic; migrating from a provider that implements thumbnail (e.g. Google Drive) and reusing the same call for OneDrive; UI not consuming the thumbnail links already present in list() output.

Related errors


AI-assisted analysis of transloadit/uppy@5d4dedd02a (2026-08-28). Data as JSON: /api/errors/467b861a9c08b5b0. Report an issue: GitHub.