juspay/hyperswitch · error · Error
Missing connectorId or methodFlow in globalState
Error message
Missing connectorId or methodFlow in globalState
What it means
Thrown by createUcsConfigs in cypress-support/commands.js when globalState lacks connectorId or methodFlow (either the flow argument or globalState.get('methodFlow')). These identify which connector and which payment method flows the UCS rollout/shadow config applies to. (Note the adjacent `if (!globalState)` check at line 256 is dead code — globalState was already dereferenced twice above — so the real guards are the ordered value checks.)
Source
Thrown at cypress-tests/cypress/support/commands.js:254
"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) {
throw new Error(
"Missing merchantId, adminApiKey, or baseUrl in globalState"
);
}
const methodFlows = parseMethodFlows(methodFlowInput);View on GitHub (pinned to 9b8b89dc37)
Solutions
- Run the spec with the required tags/env so globalState gets connectorId and methodFlow (e.g. the connector and METHOD_FLOW env)
- Pass the flow explicitly where it is known: createUcsConfigs(globalState, 'upi_intent', 'rollout')
- If UCS is not intended for this suite, set ucsEnabled false so creation is skipped with a log instead of throwing
- Move the dead !globalState check above the first globalState.get() call while you are in the file
Example fix
// before
createUcsUppConfig(globalState, 'rollout'); // no flow arg, no METHOD_FLOW env
// throws: Missing connectorId or methodFlow in globalState
// after
Cypress.env('METHOD_FLOW', 'upi_intent');
createUcsUppConfig(globalState, 'rollout');
// or pass explicitly: createUcsConfigs(globalState, 'upi_intent', 'rollout') Defensive patterns
Strategy: validation
Validate before calling
const connector = globalState.get('connectorId');
const methodFlowInput = flow || globalState.get('methodFlow');
if (!ucsEnabled) return; // explicit opt-in only
if (!connector || !methodFlowInput) {
cy.log(`UCS config creation skipped: connector=${connector}, methodFlow=${methodFlowInput}`);
return;
} Prevention
- Run UCS specs through the tagged runner so connectorId/methodFlow reach globalState
- Pass the flow explicitly when a spec knows it, reducing dependence on tags
- Fix the dead `if (!globalState)` check placement while editing this function
When it happens
Trigger: A UCS-enabled spec runs without the connector tag/param (globalState.connectorId unset) or without METHOD_FLOW configured, and createUcsConfigs was not passed an explicit flow argument.
Common situations: UCS specs invoked without the usual test tags (connector, method flow) — e.g. ad-hoc --spec runs that skip tag parsing; new specs forgetting the methodFlow tag; sharded runs where tags are injected only in some jobs.
Related errors
- Please provide a baseUrl
- Unsupported baseUrl
- Unsupported keyIdType: ${keyIdType}
- Invalid config: missing path
- methodFlow input is required
AI-assisted analysis of juspay/hyperswitch@9b8b89dc37 (2026-08-16).
Data as JSON: /api/errors/2c3eacb683f6a2d3.
Report an issue: GitHub.