juspay/hyperswitch · error · Error

Missing proxyHttp or proxyHttps in globalState. globalState.

Error message

Missing proxyHttp or proxyHttps in globalState. globalState.proxyHttp=${httpUrl}, globalState.proxyHttps=${httpsUrl}, Cypress.env("PROXY_HTTP")=${Cypress.env("PROXY_HTTP")}, Cypress.env("PROXY_HTTPS")=${Cypress.env("PROXY_HTTPS")}

What it means

Thrown by createUcsConfigs in cypress-tests/cypress/support/commands.js during UCS rollout/shadow config creation: it requires both globalState proxy URLs (proxyHttp from PROXY_HTTP and proxyHttps from PROXY_HTTPS) to talk to the UCS proxy. The message dumps both globalState values and both Cypress.env values, so it doubles as a diagnostics dump for which source is missing.

Source

Thrown at cypress-tests/cypress/support/commands.js:248

function createUcsConfigs(globalState, flow, type) {
  // --- Phase 1: Environment Setup & Validation ---
  const ucsEnabled = globalState.get("ucsEnabled");
  if (!ucsEnabled) {
    cy.task(
      "cli_log",
      `UCS ${type} config creation skipped - ucsEnabled is false or not set`
    );
    return;
  }

  const httpUrl = globalState.get("proxyHttp");
  const httpsUrl = globalState.get("proxyHttps");
  const connector = globalState.get("connectorId");
  const methodFlowInput = flow || globalState.get("methodFlow");

  if (!httpUrl || !httpsUrl) {
    throw new Error(
      `Missing proxyHttp or proxyHttps in globalState. globalState.proxyHttp=${httpUrl}, globalState.proxyHttps=${httpsUrl}, Cypress.env("PROXY_HTTP")=${Cypress.env("PROXY_HTTP")}, Cypress.env("PROXY_HTTPS")=${Cypress.env("PROXY_HTTPS")}`
    );
  }

  if (!connector || !methodFlowInput) {
    throw new Error("Missing connectorId or methodFlow in globalState");
  }

  if (!globalState) {
    throw new Error("Missing required parameter: globalState");
  }

  // --- Phase 2: Data Preparation ---
  const merchantId = globalState.get("merchantId");
  const adminApiKey = globalState.get("adminApiKey");
  const baseUrl = globalState.get("baseUrl");

  if (!merchantId || !adminApiKey || !baseUrl) {

View on GitHub (pinned to 9b8b89dc37)

Solutions

  1. Provide both env vars for the run, e.g. --env PROXY_HTTP=http://proxy:8080,PROXY_HTTPS=https://proxy:8443 (or in cypress.config/CI secrets)
  2. Use the message dump to confirm which of the four values is empty before fixing
  3. If UCS should not run in this environment, leave ucsEnabled unset/false so the function skips instead of throwing

Example fix

// before (run without proxy envs)
npx cypress run --env ucsEnabled=true
// throws: Missing proxyHttp or proxyHttps ...

// after
npx cypress run --env ucsEnabled=true,PROXY_HTTP=http://localhost:8080,PROXY_HTTPS=https://localhost:8443
Defensive patterns

Strategy: validation

Validate before calling

// Before UCS config creation
const httpUrl = globalState.get('proxyHttp') || Cypress.env('PROXY_HTTP');
const httpsUrl = globalState.get('proxyHttps') || Cypress.env('PROXY_HTTPS');
if (!httpUrl || !httpsUrl) {
  cy.log('UCS config creation skipped: PROXY_HTTP / PROXY_HTTPS not configured');
  return;
}

Prevention

When it happens

Trigger: A UCS-enabled test (ucsEnabled true in globalState) runs where globalState.get('proxyHttp')/get('proxyHttps') are empty — i.e. Cypress.env('PROXY_HTTP')/('PROXY_HTTPS') were never provided for the run (missing --env flags / CI variables).

Common situations: Running UCS specs on a machine or CI job without the proxy env vars; enabling ucsEnabled for a suite without also provisioning the proxy endpoints; renaming the env vars in config without updating commands.js.

Related errors


AI-assisted analysis of juspay/hyperswitch@9b8b89dc37 (2026-08-16). Data as JSON: /api/errors/e2d5a88ea475b618. Report an issue: GitHub.