{"record":{"id":"5b35c7c2977e78b2","repo":"FuelLabs/fuels-ts","slug":"configurable-not-found-5b35c7","errorCode":"CONFIGURABLE_NOT_FOUND","errorMessage":"Contract does not have configurables to be set","messagePattern":"Contract does not have configurables to be set","errorType":"validation","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/contract/src/contract-factory.ts","lineNumber":397,"sourceCode":"      return { contract, transactionResult };\n    };\n\n    const waitForTransactionId = () => txIdPromise;\n\n    return { waitForResult, contractId, waitForTransactionId };\n  }\n\n  /**\n   * Set configurable constants of the contract with the specified values.\n   *\n   * @param configurableConstants - An object containing configurable names and their values.\n   */\n  setConfigurableConstants(configurableConstants: { [name: string]: unknown }) {\n    try {\n      const hasConfigurable = Object.keys(this.interface.configurables).length;\n\n      if (!hasConfigurable) {\n        throw new FuelError(\n          ErrorCode.CONFIGURABLE_NOT_FOUND,\n          'Contract does not have configurables to be set'\n        );\n      }\n\n      Object.entries(configurableConstants).forEach(([key, value]) => {\n        if (!this.interface.configurables[key]) {\n          throw new FuelError(\n            ErrorCode.CONFIGURABLE_NOT_FOUND,\n            `Contract does not have a configurable named: '${key}'`\n          );\n        }\n\n        const { offset } = this.interface.configurables[key];\n\n        const encoded = this.interface.encodeConfigurable(key, value as InputValue);\n\n        const bytes = arrayify(this.bytecode);","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/contract/src/contract-factory.ts#L379-L415","documentation":"Declared in ContractFactory.setConfigurableConstants() (packages/contract/src/contract-factory.ts:397) when Object.keys(this.interface.configurables) has zero entries — the contract's ABI declares no configurable constants at all. IMPORTANT: this throw lives inside a try block (line 393) whose catch (line 421) re-wraps every error as INVALID_CONFIGURABLE_CONSTANTS (error 173). Callers therefore observe code INVALID_CONFIGURABLE_CONSTANTS with the message 'Error setting configurable constants on contract: Contract does not have configurables to be set', not code CONFIGURABLE_NOT_FOUND directly.","triggerScenarios":"Calling factory.setConfigurableConstants({...}) or passing configurableConstants in deployOptions when the contract's compiled ABI has zero configurable constants. The error is caught and re-thrown as INVALID_CONFIGURABLE_CONSTANTS (error 173) before reaching the caller.","commonSituations":"Contract compiled without any CONFIGURABLE constants in Sway; attempting to set configurables on a contract that was recompiled with configurables removed; ABI/bytecode mismatch (ABI from a different contract version); calling setConfigurableConstants speculatively.","solutions":["Remove the configurableConstants option from your deploy call if the contract has no configurables.","Recompile the Sway contract with the desired configurable constants declared and redeploy.","Verify the ABI matches the compiled bytecode — check Interface.configurables keys before calling setConfigurableConstants."],"exampleFix":"// before\nconst factory = new ContractFactory(bytecode, abi, wallet);\nawait factory.deploy({ configurableConstants: { FEE: 100 } });\n\n// after\nconst factory = new ContractFactory(bytecode, abi, wallet);\nconst hasConfigurables = Object.keys(factory.interface.configurables).length > 0;\nif (!hasConfigurables) {\n  throw new Error('This contract has no configurables in its ABI');\n}\nawait factory.deploy({ configurableConstants: { FEE: 100 } });","handlingStrategy":"validation","validationCode":"const hasConfigurables = Object.keys(factory.interface.configurables).length > 0;\nif (!hasConfigurables) {\n  throw new Error('This contract ABI has no configurable constants.');\n}\n// Note: setConfigurableConstants wraps this as INVALID_CONFIGURABLE_CONSTANTS\nfactory.setConfigurableConstants({ MY_CONFIG: value });","typeGuard":"function hasConfigurablesInAbi(factory: ContractFactory): boolean {\n  return Object.keys(factory.interface.configurables).length > 0;\n}","tryCatchPattern":"try {\n  factory.setConfigurableConstants(configurables);\n} catch (e) {\n  // Note: code will be INVALID_CONFIGURABLE_CONSTANTS, not CONFIGURABLE_NOT_FOUND\n  if (e instanceof FuelError && e.code === 'invalid-configurable-constants') {\n    if (e.message.includes('does not have configurables')) {\n      // contract has zero configurables in ABI\n    }\n  }\n  throw e;\n}","preventionTips":["Check Object.keys(factory.interface.configurables).length before setting configurables.","Ensure the ABI used for the factory matches the compiled Sway contract with configurables declared.","Be aware that this error is masked by INVALID_CONFIGURABLE_CONSTANTS — inspect the inner message."],"tags":["contract","configurables","abi","masked-error","deployment"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}