FlowiseAI/Flowise · error · Error
Error: getRegions - ${e}
Error message
Error: getRegions - ${e} What it means
getRegions(category, name) loads the model registry (from MODEL_LIST_CONFIG_JSON URL, env-overridable, else bundled models.json), finds the provider config under models[category] by name, and spreads its .regions array. Any failure is caught and rethrown wrapped as 'Error: getRegions - <cause>'. The most common inner cause is a TypeError: getModelConfig returns undefined when the provider name is unknown, so modelConfig.regions throws 'Cannot read properties of undefined (reading regions)'. Network/parse failures from getRawModelFile are also wrapped here.
Source
Thrown at packages/components/src/modelLoader.ts:108
export const getModels = async (category: MODEL_TYPE, name: string) => {
const returnData: INodeOptionsValue[] = []
try {
const modelConfig = await getModelConfig(category, name)
returnData.push(...modelConfig.models)
return returnData
} catch (e) {
throw new Error(`Error: getModels - ${e}`)
}
}
export const getRegions = async (category: MODEL_TYPE, name: string) => {
const returnData: INodeOptionsValue[] = []
try {
const modelConfig = await getModelConfig(category, name)
returnData.push(...modelConfig.regions)
return returnData
} catch (e) {
throw new Error(`Error: getRegions - ${e}`)
}
}
View on GitHub (pinned to abe4a8601a)
Solutions
- Read the suffix after 'getRegions - ' to get the real cause (e.g. 'Cannot read properties of undefined (reading regions)' means the provider name was not found).
- Verify the provider name exists under the correct category in the active models.json (check process.env.MODEL_LIST_CONFIG_JSON, or unset it to use the bundled file).
- Ensure the provider entry actually has a non-null 'regions' array before calling getRegions.
- If offline, ship a local models.json and point MODEL_LIST_CONFIG_JSON at it.
Example fix
// before: provider name typo / missing regions await getRegions(MODEL_TYPE.CHAT, 'bedrock') // throws if 'bedrock' absent or has no regions // after: guard the lookup, fall back gracefully const cfg = await getModelConfigByModelName(MODEL_TYPE.CHAT, 'bedrock', undefined) if (!cfg || !Array.isArray(cfg.regions)) return [] return cfg.regions
Defensive patterns
Strategy: try-catch
Validate before calling
import { getModelConfigByModelName, MODEL_TYPE } from './modelLoader'
async function safeGetRegions(category: MODEL_TYPE, provider: string) {
const cfg = await getModelConfigByModelName(category, provider, undefined)
if (!cfg || !Array.isArray((cfg as any).regions)) return []
return (cfg as any).regions
} Type guard
const hasRegions = (cfg: unknown): cfg is { regions: unknown[] } =>
!!cfg && typeof cfg === 'object' && Array.isArray((cfg as any).regions) Try / catch
try {
const regions = await getRegions(category, name)
} catch (e) {
// suffix after 'Error: getRegions - ' holds the real cause
const cause = (e as Error).message.replace(/^Error: getRegions - /, '')
logger.warn(`getRegions failed for ${name}: ${cause}`)
return []
} Prevention
- Validate the provider name against the loaded registry before calling getRegions.
- Always treat the model list as possibly-missing and provide a default empty regions list.
- Pin MODEL_LIST_CONFIG_JSON to a version-controlled local file in production for deterministic lookups.
When it happens
Trigger: Calling getRegions(MODEL_TYPE.CHAT, 'nonexistent') where no provider matches; MODEL_LIST_CONFIG_JSON points at an unreachable URL and the bundled fallback file is missing/malformed; the located provider object has no 'regions' field; the registry's category array is missing so models[category].find throws.
Common situations: Provider renamed or removed upstream in models.json; typo in the provider name passed from a node's loadMethods; offline/air-gapped dev where raw.githubusercontent.com is blocked; stale custom MODEL_LIST_CONFIG_JSON after a Flowise upgrade that changed the schema.
Related errors
- Model is required
- Invalid Flow State
- Tool not selected
- Assistant ${selectedAssistantId} not found
- OpenAI ApiKey not found
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/d068aea724a91262.
Report an issue: GitHub.