{"record":{"id":"6f84aed7ec1441de","repo":"vercel/ai","slug":"description-setting-is-missing-pass-it-using-t-6f84ae","errorCode":null,"errorMessage":"${description} setting is missing. Pass it using the '${settingName}' parameter or the ${environmentVariableName} environment variable.","messagePattern":"(.+?) setting is missing\\. Pass it using the '(.+?)' parameter or the (.+?) environment variable\\.","errorType":"exception","errorClass":"LoadSettingError","httpStatus":null,"severity":"error","filePath":"packages/provider-utils/src/load-setting.ts","lineNumber":45,"sourceCode":"  if (settingValue != null) {\n    throw new LoadSettingError({\n      message: `${description} setting must be a string.`,\n    });\n  }\n\n  if (typeof process === 'undefined') {\n    throw new LoadSettingError({\n      message:\n        `${description} setting is missing. ` +\n        `Pass it using the '${settingName}' parameter. ` +\n        `Environment variables are not supported in this environment.`,\n    });\n  }\n\n  settingValue = process.env[environmentVariableName];\n\n  if (settingValue == null) {\n    throw new LoadSettingError({\n      message:\n        `${description} setting is missing. ` +\n        `Pass it using the '${settingName}' parameter ` +\n        `or the ${environmentVariableName} environment variable.`,\n    });\n  }\n\n  if (typeof settingValue !== 'string') {\n    throw new LoadSettingError({\n      message:\n        `${description} setting must be a string. ` +\n        `The value of the ${environmentVariableName} environment variable is not a string.`,\n    });\n  }\n\n  return settingValue;\n}\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/provider-utils/src/load-setting.ts#L27-L63","documentation":"loadSetting found neither the named parameter nor the expected environment variable, so it throws LoadSettingError naming both. This is the standard 'required setting not configured' failure for string settings like region.","triggerScenarios":"Creating a provider without the setting option while process.env[environmentVariableName] (e.g. AWS_REGION for Bedrock) is unset.","commonSituations":"Missing AWS_REGION/region config in local dev; CI missing the secret; .env not loaded; deploying a Bedrock provider without platform env vars configured.","solutions":["Set the indicated environment variable (e.g. export AWS_REGION=us-east-1) or add to .env","Or pass the setting explicitly: createAmazonBedrock({ region: 'us-east-1' })","Verify exact variable name/casing expected by the provider","Add the value to your deployment platform's environment configuration"],"exampleFix":"// before\nconst bedrock = createAmazonBedrock();\n// after\nconst bedrock = createAmazonBedrock({ region: process.env.AWS_REGION });","handlingStrategy":"validation","validationCode":"const region = process.env.AWS_REGION;\nif (!region) throw new Error('AWS_REGION is not set. Export it or pass createAmazonBedrock({ region }).');\nconst bedrock = createAmazonBedrock({ region });","typeGuard":"function hasSetting(value: unknown): value is string {\n  return typeof value === 'string' && value.length > 0;\n}","tryCatchPattern":"try {\n  const bedrock = createAmazonBedrock();\n} catch (error) {\n  if (/setting is missing/.test(String(error.message))) {\n    console.error('Set AWS_REGION (or pass { region }) before using the Bedrock provider');\n    process.exit(1);\n  }\n  throw error;\n}","preventionTips":["Add required settings to .env.example and a startup validation step","Configure the variables in CI/deployment environments","Check the provider docs for the exact environment variable name"],"tags":["configuration","environment","settings"],"backgroundTag":"missing-env-var","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}