FuelLabs/fuels-ts · error · FuelError
CONFIGURABLE_NOT_FOUND
CONFIGURABLE_NOT_FOUND
Error message
Contract does not have configurables to be set
What it means
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.
Source
Thrown at packages/contract/src/contract-factory.ts:397
return { contract, transactionResult };
};
const waitForTransactionId = () => txIdPromise;
return { waitForResult, contractId, waitForTransactionId };
}
/**
* Set configurable constants of the contract with the specified values.
*
* @param configurableConstants - An object containing configurable names and their values.
*/
setConfigurableConstants(configurableConstants: { [name: string]: unknown }) {
try {
const hasConfigurable = Object.keys(this.interface.configurables).length;
if (!hasConfigurable) {
throw new FuelError(
ErrorCode.CONFIGURABLE_NOT_FOUND,
'Contract does not have configurables to be set'
);
}
Object.entries(configurableConstants).forEach(([key, value]) => {
if (!this.interface.configurables[key]) {
throw new FuelError(
ErrorCode.CONFIGURABLE_NOT_FOUND,
`Contract does not have a configurable named: '${key}'`
);
}
const { offset } = this.interface.configurables[key];
const encoded = this.interface.encodeConfigurable(key, value as InputValue);
const bytes = arrayify(this.bytecode);View on GitHub (pinned to b3f37c91ac)
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.
Example fix
// before
const factory = new ContractFactory(bytecode, abi, wallet);
await factory.deploy({ configurableConstants: { FEE: 100 } });
// after
const factory = new ContractFactory(bytecode, abi, wallet);
const hasConfigurables = Object.keys(factory.interface.configurables).length > 0;
if (!hasConfigurables) {
throw new Error('This contract has no configurables in its ABI');
}
await factory.deploy({ configurableConstants: { FEE: 100 } }); Defensive patterns
Strategy: validation
Validate before calling
const hasConfigurables = Object.keys(factory.interface.configurables).length > 0;
if (!hasConfigurables) {
throw new Error('This contract ABI has no configurable constants.');
}
// Note: setConfigurableConstants wraps this as INVALID_CONFIGURABLE_CONSTANTS
factory.setConfigurableConstants({ MY_CONFIG: value }); Type guard
function hasConfigurablesInAbi(factory: ContractFactory): boolean {
return Object.keys(factory.interface.configurables).length > 0;
} Try / catch
try {
factory.setConfigurableConstants(configurables);
} catch (e) {
// Note: code will be INVALID_CONFIGURABLE_CONSTANTS, not CONFIGURABLE_NOT_FOUND
if (e instanceof FuelError && e.code === 'invalid-configurable-constants') {
if (e.message.includes('does not have configurables')) {
// contract has zero configurables in ABI
}
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- INVALID_CONFIGURABLE_CONSTANTS
- CONFIGURABLE_NOT_FOUND
- FUNCTION_NOT_FOUND
- MISSING_PROVIDER
- CONTRACT_SIZE_EXCEEDS_LIMIT
AI-assisted analysis of FuelLabs/fuels-ts@b3f37c91ac (2026-08-12).
Data as JSON: /api/errors/5b35c7c2977e78b2.
Report an issue: GitHub.