{"record":{"id":"be7c01ce029fc830","repo":"FuelLabs/fuels-ts","slug":"configurable-not-found-be7c01","errorCode":"CONFIGURABLE_NOT_FOUND","errorMessage":"No configurable constant named '${key}' found in the Predicate","messagePattern":"No configurable constant named '(.+?)' found in the Predicate","errorType":"validation","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/account/src/predicate/predicate.ts","lineNumber":297,"sourceCode":"   */\n  private static setConfigurableConstants(\n    bytes: Uint8Array,\n    configurableConstants: { [name: string]: unknown },\n    abiInterface: Interface\n  ) {\n    const mutatedBytes = bytes;\n\n    try {\n      if (Object.keys(abiInterface.configurables).length === 0) {\n        throw new FuelError(\n          ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,\n          'Predicate has no configurable constants to be set'\n        );\n      }\n\n      Object.entries(configurableConstants).forEach(([key, value]) => {\n        if (!abiInterface?.configurables[key]) {\n          throw new FuelError(\n            ErrorCode.CONFIGURABLE_NOT_FOUND,\n            `No configurable constant named '${key}' found in the Predicate`\n          );\n        }\n\n        const { offset } = abiInterface.configurables[key];\n\n        const encoded = abiInterface.encodeConfigurable(key, value as InputValue);\n\n        mutatedBytes.set(encoded, offset);\n      });\n    } catch (err) {\n      throw new FuelError(\n        ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,\n        `Error setting configurable constants: ${(<Error>err).message}.`\n      );\n    }\n","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/account/src/predicate/predicate.ts#L279-L315","documentation":"Thrown by Predicate.setConfigurableConstants when a key in the supplied configurableConstants map does not match any configurable name declared in the predicate's ABI. The lookup abiInterface.configurables[key] is undefined, so the SDK cannot find the bytecode offset at which to patch the encoded value. This is a name-mismatch error, fired per offending key.","triggerScenarios":"Passing configurableConstants whose keys differ from the ABI's configurable names (e.g. wrong casing, renamed constant, extra key); using snake_case vs camelCase inconsistently between Sway and TS; passing a constant from a different predicate version.","commonSituations":"Sway configurable was renamed (e.g. MAX_FEE -> FEE_LIMIT) but caller still uses the old name; TS code uses camelCase while Sway uses UPPER_SNAKE_CASE; ABI is from a different predicate build; typo in the key string.","solutions":["Open the ABI JSON and list the actual keys under configurables; pass only those exact names.","Match the Sway-side casing exactly (configurables are not auto-camelCased).","Recompile the predicate and regenerate the ABI/typedefs if you renamed a constant in Sway.","Remove the offending key from configurableConstants or correct its name."],"exampleFix":"// before — Sway declared `configurable AMOUNT: u64 = 0;` but caller passes 'amount'\nnew Predicate({ bytecode, abi, configurableConstants: { amount: 100 } });\n\n// after — match the ABI's exact key\nnew Predicate({ bytecode, abi, configurableConstants: { AMOUNT: 100 } });","handlingStrategy":"validation","validationCode":"function filterKnownConfigurables(\n  config: Record<string, unknown>,\n  abi: any\n): Record<string, unknown> {\n  const known = new Set(Object.keys(abi?.configurables ?? {}));\n  const invalid = Object.keys(config).filter(k => !known.has(k));\n  if (invalid.length) throw new Error(`Unknown configurables: ${invalid.join(', ')}`);\n  return config;\n}","typeGuard":"function isKnownConfigurable(key: string, abi: any): boolean {\n  return Object.prototype.hasOwnProperty.call(abi?.configurables ?? {}, key);\n}","tryCatchPattern":"import { FuelError, ErrorCode } from '@fuel-ts/errors';\ntry {\n  new Predicate({ bytecode, abi, configurableConstants });\n} catch (e) {\n  if (e instanceof FuelError && e.code === ErrorCode.CONFIGURABLE_NOT_FOUND) {\n    // inspect abi.configurables keys and correct the map\n  }\n  throw e;\n}","preventionTips":["Read configurable names directly from abi.configurables.","Match Sway casing exactly (no automatic camelCase).","Regenerate typedefs after renaming a Sway configurable."],"tags":["predicate","abi","configurable","validation"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}