transloadit/uppy · warning · DOMException

AbortError

AbortError

Error message

Request aborted

What it means

The token refresh route /:providerName/refresh-token requires a non-empty string providerName path parameter; 400 is returned when it is missing or empty.

Source

Thrown at packages/@uppy/aws-s3/src/s3-client/S3Client.ts:84

  protected async xhr({
    url,
    method,
    data,
    onProgress,
    signal,
    contentType,
  }: {
    url: string
    method: IT.HttpMethod
    data?: XMLHttpRequestBodyInit
    onProgress?: IT.OnProgressFn
    signal?: AbortSignal
    contentType?: string
  }) {
    // Check if aborted while waiting for online
    if (signal?.aborted) {
      throw new DOMException('Request aborted', 'AbortError')
    }

    return fetcher(url, {
      method,
      // XHR natively supports ArrayBuffer, Uint8Array, Blob, and string
      body: ['GET', 'HEAD'].includes(method) ? undefined : data,
      headers: contentType ? { 'Content-Type': contentType } : {},
      signal,
      timeout: this.requestAbortTimeout,
      retries: 3,
      /**
       * Retry logic:
       * - Retries: 5xx server errors, 429 rate limiting
       * - Skips: 4xx client errors (except 429), offline (handled separately)
       */
      shouldRetry: (xhr) => {
        // If offline, don't retry via fetcher - our handler will resume
        if (this.isOffline()) return false

View on GitHub (pinned to 5d4dedd02a)

Solutions

  1. Include the provider name in the path, e.g. /companion/drive/refresh-token
  2. Validate the provider name is a non-empty string before making the request
  3. Fix proxy rewrite rules if the segment is being dropped

Example fix

// before
fetch(`${companionUrl}/refresh-token`, { method: 'POST' })
// after
fetch(`${companionUrl}/${providerName}/refresh-token`, { method: 'POST' })
Defensive patterns

Strategy: validation

Validate before calling

if (!providerName) throw new Error('provider name required')
await fetch(`${companionUrl}/${encodeURIComponent(providerName)}/refresh-token`, { method: 'POST' })

Type guard

const isNonEmptyString = (s: unknown): s is string => typeof s === 'string' && s.length > 0

Prevention

When it happens

Trigger: Calling /refresh-token without a provider segment; building the URL from an undefined provider name on the client.

Common situations: Client-side URL construction bugs; path prefix stripped by a reverse proxy; provider name variable shadowed or undefined after a refactor.

Related errors


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