{"record":{"id":"f74caabe758a1cd4","repo":"FuelLabs/fuels-ts","slug":"configurable-not-found-f74caa","errorCode":"CONFIGURABLE_NOT_FOUND","errorMessage":"The script does not have a configurable constant named: '${key}'","messagePattern":"The script does not have a configurable constant named: '(.+?)'","errorType":"exception","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/script/src/script.ts","lineNumber":102,"sourceCode":"  /**\n   * Set the configurable constants of the script.\n   *\n   * @param configurables - An object containing the configurable constants and their values.\n   * @throws Will throw an error if the script has no configurable constants to be set or if an invalid constant is provided.\n   * @returns This instance of the `Script`.\n   */\n  setConfigurableConstants(configurables: { [name: string]: unknown }) {\n    try {\n      if (!Object.keys(this.interface.configurables).length) {\n        throw new FuelError(\n          FuelError.CODES.INVALID_CONFIGURABLE_CONSTANTS,\n          `The script does not have configurable constants to be set`\n        );\n      }\n\n      Object.entries(configurables).forEach(([key, value]) => {\n        if (!this.interface.configurables[key]) {\n          throw new FuelError(\n            FuelError.CODES.CONFIGURABLE_NOT_FOUND,\n            `The script does not have a configurable constant 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        this.bytes.set(encoded, offset);\n      });\n    } catch (err) {\n      throw new FuelError(\n        FuelError.CODES.INVALID_CONFIGURABLE_CONSTANTS,\n        `Error setting configurable constants: ${(<Error>err).message}.`\n      );\n    }\n","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/script/src/script.ts#L84-L120","documentation":"Thrown by Script.setConfigurableConstants() when a key in the supplied configurables object does not match any name in interface.configurables. Each configurable must exist in the ABI so its offset is known for patching the bytecode; an unknown name means either a typo or a stale ABI.","triggerScenarios":"Calling setConfigurableConstants({ WRONG: ... }) where WRONG is not declared in the Sway configurable block; renaming a configurable in Sway but passing the old key; case mismatch.","commonSituations":"Typos; stale typegen after renaming a configurable; passing camelCase vs the Sway-declared SCREAMING_SNAKE_CASE name.","solutions":["Inspect the script ABI / interface.configurables keys and use the exact declared name.","Regenerate types (typegen) after changing configurable names in Sway.","Match casing exactly (Sway configurables are typically SCREAMING_SNAKE_CASE)."],"exampleFix":"// before\nscript.setConfigurableConstants({ fee_rate: 200 }); // typo / wrong case\n\n// after\nscript.setConfigurableConstants({ FEE_RATE: 200 });","handlingStrategy":"validation","validationCode":"function isValidConfigurableName(script: { interface: { configurables: Record<string, unknown> } }, name: string): boolean {\n  return name in script.interface.configurables;\n}\n\nfor (const key of Object.keys(values)) {\n  if (!isValidConfigurableName(script, key)) {\n    throw new Error(`Unknown configurable '${key}'. Known: ${Object.keys(script.interface.configurables).join(', ')}`);\n  }\n}","typeGuard":"function isKnownConfigurable(script: { interface: { configurables: Record<string, unknown> } }, name: string): boolean {\n  return name in script.interface.configurables;\n}","tryCatchPattern":"try {\n  script.setConfigurableConstants(values);\n} catch (e) {\n  if (e instanceof FuelError && e.code === FuelError.CODES.CONFIGURABLE_NOT_FOUND) {\n    // correct the key names against interface.configurables, regenerate types if stale\n  } else throw e;\n}","preventionTips":["Regenerate types whenever you rename configurables in Sway.","Use the exact declared name (typically SCREAMING_SNAKE_CASE).","Validate keys against interface.configurables before setting."],"tags":["configurable","script","abi","typescript"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}