FuelLabs/fuels-ts · error · FuelError
CONFIGURABLE_NOT_FOUND
CONFIGURABLE_NOT_FOUND
Error message
A configurable with the '${name}' was not found in the ABI. What it means
Thrown by `Interface.encodeConfigurable` (code `CONFIGURABLE_NOT_FOUND`) when the ABI's `configurables` array has no entry with the requested `name`. Configurables are Sway contract constants whose value can be set at deploy time; the encoder needs the declared type to encode the supplied value.
Source
Thrown at packages/abi-coder/src/Interface.ts:80
decodeLog(data: BytesLike, logId: string): any {
const loggedType = this.jsonAbiOld.loggedTypes.find((type) => type.logId === logId);
if (!loggedType) {
throw new FuelError(
ErrorCode.LOG_TYPE_NOT_FOUND,
`Log type with logId '${logId}' doesn't exist in the ABI.`
);
}
return AbiCoder.decode(this.jsonAbiOld, loggedType.loggedType, arrayify(data), 0, {
encoding: this.encoding,
});
}
encodeConfigurable(name: string, value: InputValue) {
const configurable = this.jsonAbiOld.configurables.find((c) => c.name === name);
if (!configurable) {
throw new FuelError(
ErrorCode.CONFIGURABLE_NOT_FOUND,
`A configurable with the '${name}' was not found in the ABI.`
);
}
return AbiCoder.encode(this.jsonAbiOld, configurable.configurableType, value, {
encoding: this.encoding,
});
}
encodeType(concreteTypeId: string, value: InputValue): Uint8Array {
const typeArg = parseConcreteType(
this.jsonAbi,
this.jsonAbiOld.types,
concreteTypeId,
''
) as JsonAbiArgument;
return AbiCoder.encode(this.jsonAbiOld, typeArg, value, {View on GitHub (pinned to b3f37c91ac)
Solutions
- Enumerate valid names with `interface.jsonAbiOld.configurables.map(c => c.name)` and use an exact match.
- Regenerate types and use the generated configurable accessor instead of a string name.
- Confirm the contract source (`configurables.rs` / `Configurable` block) actually declares the configurable you reference.
Example fix
// before
contract.setConfigurable('MinAmount', 100);
// after — match the Sway configurable name exactly
contract.setConfigurable('MIN_AMOUNT', 100); Defensive patterns
Strategy: validation
Validate before calling
const known = iface.jsonAbiOld.configurables.some((c) => c.name === name);
if (!known) throw new Error(`Unknown configurable: ${name}`); Type guard
function hasConfigurable(iface, name) {
return iface.jsonAbiOld.configurables.some((c) => c.name === name);
} Try / catch
try {
contract.setConfigurable(name, value);
} catch (e) {
if (e.code === 'CONFIGURABLE_NOT_FOUND') {
console.error('Valid configurables:', iface.jsonAbiOld.configurables.map(c => c.name));
}
throw e;
} Prevention
- Use generated configurable accessors instead of raw string names.
- Regenerate bindings after renames in the Sway `Configurable` block.
- Match the case of the Sway-declared configurable name exactly.
When it happens
Trigger: Calling `contract.setConfigurable('wrongName', value)`; accessing a configurable that was renamed or removed in a newer Sway contract; typo in the configurable name.
Common situations: Regenerated ABI after a configurable rename and call sites not updated; deploying a different contract version than the one the client code targets; case/format mismatch in the name string.
Related errors
- DECODE_ERROR
- FUNCTION_NOT_FOUND
- LOG_TYPE_NOT_FOUND
- CONFIGURABLE_NOT_FOUND
- INVALID_CONFIGURABLE_CONSTANTS
AI-assisted analysis of FuelLabs/fuels-ts@b3f37c91ac (2026-08-12).
Data as JSON: /api/errors/4c3b177a21fe863c.
Report an issue: GitHub.