{"record":{"id":"858cc05c98ff80a6","repo":"vercel/ai","slug":"description-setting-is-missing-pass-it-using-t","errorCode":null,"errorMessage":"${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables are not supported in this environment.","messagePattern":"(.+?) setting is missing\\. Pass it using the '(.+?)' parameter\\. Environment variables are not supported in this environment\\.","errorType":"exception","errorClass":"LoadSettingError","httpStatus":null,"severity":"error","filePath":"packages/provider-utils/src/load-setting.ts","lineNumber":34,"sourceCode":"  description,\n}: {\n  settingValue: string | undefined;\n  environmentVariableName: string;\n  settingName: string;\n  description: string;\n}): string {\n  if (typeof settingValue === 'string') {\n    return settingValue;\n  }\n\n  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","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/provider-utils/src/load-setting.ts#L16-L52","documentation":"loadSetting could not resolve a required setting: no value was passed via the named parameter and `process` is undefined, so environment variables cannot be read. It throws LoadSettingError instructing you to pass the setting explicitly.","triggerScenarios":"Constructing a provider that requires a setting (e.g. createAmazonBedrock() without region) in a runtime without the Node process global (Edge, Workers, browser).","commonSituations":"Edge deployments where AMZN_REGION-style env vars are unavailable; browser code instantiating a server-oriented provider; workers lacking Node compat.","solutions":["Pass the setting explicitly: createAmazonBedrock({ region: env.AWS_REGION })","Forward platform env bindings into the factory call in edge/serverless code","Enable Node.js runtime compatibility if available","Move provider creation into a server-side module where env access exists"],"exampleFix":"// before (edge runtime)\nconst bedrock = createAmazonBedrock();\n// after\nconst bedrock = createAmazonBedrock({ region: env.AWS_REGION });","handlingStrategy":"validation","validationCode":"if (typeof process === 'undefined' && !env.AWS_REGION) {\n  throw new Error('Pass region explicitly: env vars are unavailable in this runtime');\n}\nconst bedrock = createAmazonBedrock({ region: env.AWS_REGION });","typeGuard":"function canUseProcessEnv(): boolean {\n  return typeof process !== 'undefined' && typeof process.env === 'object';\n}","tryCatchPattern":"try {\n  const bedrock = createAmazonBedrock();\n} catch (error) {\n  if (/setting is missing/.test(String(error.message))) {\n    throw new Error('Set AWS_REGION or pass createAmazonBedrock({ region }) in this runtime');\n  }\n  throw error;\n}","preventionTips":["Forward platform env bindings explicitly in edge/serverless code","Create providers only in server-side modules where configuration is available","Fail fast at boot if required settings are missing in non-Node runtimes"],"tags":["configuration","environment","edge-runtime","settings"],"backgroundTag":"missing-env-var","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}