Semantic-Org/Semantic-UI · error

Your request timed out

Error message

Your request timed out

What it means

This error message is defined in the API module's settings.error dictionary under the 'timeout' key. It is surfaced through the dynamic lookup settings.error[status] (api.js:705-706) when jQuery's AJAX request fails with a textStatus of 'timeout'. The errorFromRequest function returns this message when the response object lacks a structured error field and the status matches 'timeout'. It indicates the request exceeded the configured timeout duration.

Source

Thrown at src/definitions/behaviors/api.js:1141

  successTest : false,

  // errors
  error : {
    beforeSend        : 'The before send function has aborted the request',
    error             : 'There was an error with your request',
    exitConditions    : 'API Request Aborted. Exit conditions met',
    JSONParse         : 'JSON could not be parsed during error handling',
    legacyParameters  : 'You are using legacy API success callback names',
    method            : 'The method you called is not defined',
    missingAction     : 'API action used but no url was defined',
    missingSerialize  : 'jquery-serialize-object is required to add form data to an existing data object',
    missingURL        : 'No URL specified for api event',
    noReturnedValue   : 'The beforeSend callback must return a settings object, beforeSend ignored.',
    noStorage         : 'Caching responses locally requires session storage',
    parseError        : 'There was an error parsing your request',
    requiredParameter : 'Missing a required URL parameter: ',
    statusMessage     : 'Server gave an error: ',
    timeout           : 'Your request timed out'
  },

  regExp  : {
    required : /\{\$*[A-z0-9]+\}/g,
    optional : /\{\/\$*[A-z0-9]+\}/g,
  },

  className: {
    loading : 'loading',
    error   : 'error'
  },

  selector: {
    disabled : '.disabled',
    form      : 'form'
  },

  metadata: {

View on GitHub (pinned to 597843ab84)

Solutions

  1. Increase settings.timeout to accommodate realistic server response times.
  2. Optimize the server endpoint to respond faster (query optimization, caching, pagination).
  3. Implement retry logic with exponential backoff for transient timeout failures.
  4. Use settings.onAbort or settings.onError to provide user feedback on timeouts.

Example fix

// before
$('.el').api({
  url: '/api/heavy-query',
  timeout: 3000 // too short for this endpoint
});

// after
$('.el').api({
  url: '/api/heavy-query',
  timeout: 30000,
  onError: function(errorMessage, $module, xhr) {
    if (xhr.statusText === 'timeout') {
      $module.text('Request timed out. Retrying...');
      setTimeout(function() { $('.el').api('query'); }, 2000);
    }
  }
});
Defensive patterns

Strategy: retry

Validate before calling

// Set an appropriate timeout and detect timeout conditions
$('.el').api({
  url: '/api/data',
  timeout: 30000,
  onError: function(errorMessage, $module, xhr) {
    if (xhr && xhr.statusText === 'timeout') {
      console.warn('Request timed out; consider retrying or optimizing the endpoint.');
    }
  }
});

Type guard

// Check if an XHR failure was due to timeout
function isTimeoutError(xhr) {
  return xhr && xhr.statusText === 'timeout';
}

Try / catch

// Retry pattern for transient timeouts
var retryCount = 0;
var maxRetries = 3;
$('.el').api({
  url: '/api/data',
  timeout: 15000,
  onError: function(errorMessage, $module, xhr) {
    if (isTimeoutError(xhr) && retryCount < maxRetries) {
      retryCount++;
      setTimeout(function() { $('.el').api('query'); }, 1000 * retryCount);
    } else {
      console.error('Request failed after retries:', errorMessage);
    }
  }
});

Prevention

When it happens

Trigger: An API module request exceeds settings.timeout (in milliseconds) without receiving a response. jQuery aborts the request and reports status 'timeout'. The fail handler (api.js:558) fires, and errorFromRequest returns settings.error['timeout']. This occurs with slow server responses, network latency, or an unreasonably low timeout setting.

Common situations: Default timeout being too short for heavy server-side processing. Network congestion or high latency on mobile connections. Server-side long-running queries without pagination. Load balancer or proxy timeout thresholds lower than the client-side timeout. Requests to third-party APIs with unpredictable response times.

Understand the failure class

Related errors


AI-assisted analysis of Semantic-Org/Semantic-UI@597843ab84 (2026-08-13). Data as JSON: /api/errors/c8fd9f9d39a05c85. Report an issue: GitHub.