{"record":{"id":"0182888b85ca0755","repo":"FuelLabs/fuels-ts","slug":"invalid-configurable-constants","errorCode":"INVALID_CONFIGURABLE_CONSTANTS","errorMessage":"Predicate has no configurable constants to be set","messagePattern":"Predicate has no configurable constants to be set","errorType":"validation","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/account/src/predicate/predicate.ts","lineNumber":289,"sourceCode":"\n  /**\n   * Sets the configurable constants for the predicate.\n   *\n   * @param bytes - The bytes of the predicate.\n   * @param configurableConstants - Configurable constants to be set.\n   * @param abiInterface - The ABI interface of the predicate.\n   * @returns The mutated bytes with the configurable constants set.\n   */\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);","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/account/src/predicate/predicate.ts#L271-L307","documentation":"Thrown by Predicate.setConfigurableConstants when configurableConstants were supplied to a Predicate whose ABI declares zero configurable constants. The SDK refuses because there is nothing to patch into the bytecode; passing values indicates a mismatch between the caller's expectations and the compiled predicate. The error is distinct from CONFIGURABLE_NOT_FOUND, which fires per-key when a specific name is missing.","triggerScenarios":"Calling new Predicate({ configurableConstants: { ... } }) (or Predicate.setup) with a non-empty configurableConstants map while the predicate's ABI has an empty configurables object; passing config that belongs to a different predicate whose ABI you are not using.","commonSituations":"Predicate source has no configurable constants declared but the caller still passes a map (often copy-pasted from another predicate); predicate was recompiled with configurables removed but caller code was not updated; ABI file is stale and predates the addition/removal of configurables.","solutions":["Check the predicate Sway source: if no configurable constants are declared, remove the configurableConstants argument entirely.","If constants are expected, recompile the predicate and pass the matching ABI so configurables is populated.","Verify you are loading the correct ABI file (the one compiled from the predicate whose bytecode you pass).","Conditionally pass configurableConstants only when Object.keys(abi.configurables).length > 0."],"exampleFix":"// before — predicate has no configurables, but values are passed\nnew Predicate({ bytecode, abi, configurableConstants: { FEE: 10 } });\n\n// after — omit configurableConstants when the ABI declares none\nnew Predicate({ bytecode, abi });\n\n// or, if constants are expected, recompile so abi.configurables is non-empty\nnew Predicate({ bytecode, abiWithConfigurables, configurableConstants: { FEE: 10 } });","handlingStrategy":"validation","validationCode":"function shouldPassConfigurables(abi: any, config?: Record<string, unknown>) {\n  if (!config || Object.keys(config).length === 0) return undefined;\n  if (!abi?.configurables || Object.keys(abi.configurables).length === 0) {\n    throw new Error('ABI declares no configurable constants');\n  }\n  return config;\n}","typeGuard":"function abiHasConfigurables(abi: any): boolean {\n  return !!abi?.configurables && Object.keys(abi.configurables).length > 0;\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.INVALID_CONFIGURABLE_CONSTANTS) {\n    // drop configurableConstants if the predicate has none\n  }\n  throw e;\n}","preventionTips":["Only pass configurableConstants when abi.configurables is non-empty.","Recompile and pair bytecode+ABI so configurables are consistent.","Gate config behind a check of the ABI's configurables keys."],"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"}