{"record":{"id":"5ea1ddeb43764836","repo":"FuelLabs/fuels-ts","slug":"invalid-input-parameters","errorCode":"INVALID_INPUT_PARAMETERS","errorMessage":"Invalid Typegen programType: ${programType}. Must be one of ${Object.values(ProgramTypeEnum)}","messagePattern":"Invalid Typegen programType: (.+?)\\. Must be one of (.+?)","errorType":"exception","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/abi-typegen/src/AbiTypeGen.ts","lineNumber":88,"sourceCode":"    });\n\n    // Assemble list of files to be written to disk\n    this.files = this.getAssembledFiles({ programType });\n  }\n\n  private getAssembledFiles(params: { programType: ProgramTypeEnum }): IFile[] {\n    const { abis, outputDir, versions } = this;\n    const { programType } = params;\n\n    switch (programType) {\n      case ProgramTypeEnum.CONTRACT:\n        return assembleContracts({ abis, outputDir, versions });\n      case ProgramTypeEnum.SCRIPT:\n        return assembleScripts({ abis, outputDir, versions });\n      case ProgramTypeEnum.PREDICATE:\n        return assemblePredicates({ abis, outputDir, versions });\n      default:\n        throw new FuelError(\n          ErrorCode.INVALID_INPUT_PARAMETERS,\n          `Invalid Typegen programType: ${programType}. Must be one of ${Object.values(\n            ProgramTypeEnum\n          )}`\n        );\n    }\n  }\n}\n","sourceCodeStart":70,"sourceCodeEnd":97,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/abi-typegen/src/AbiTypeGen.ts#L70-L97","documentation":"AbiTypeGen.getAssembledFiles switches over ProgramTypeEnum to dispatch to the correct assembler (contracts/scripts/predicates). Any value outside CONTRACT/SCRIPT/PREDICATE reaches default and is rejected, because no assembler exists for it.","triggerScenarios":"Constructing AbiTypeGen (or invoking the typegen CLI/API) with a programType not in ProgramTypeEnum; passing a raw string instead of the enum; typo in the enum value.","commonSituations":"Calling runTypegen/AbiTypeGen programmatically with a hardcoded string; the enum value source changed across SDK versions; downstream code passing a custom program kind.","solutions":["Import ProgramTypeEnum and pass one of ProgramTypeEnum.CONTRACT, SCRIPT, or PREDICATE.","Validate the supplied value against Object.values(ProgramTypeEnum) before constructing AbiTypeGen."],"exampleFix":"// before\nnew AbiTypeGen({ programType: 'contract', ... });\n\n// after\nimport { ProgramTypeEnum } from '@fuel-ts/abi-typegen';\nnew AbiTypeGen({ programType: ProgramTypeEnum.CONTRACT, ... });","handlingStrategy":"type-guard","validationCode":"import { ProgramTypeEnum } from '@fuel-ts/abi-typegen';\nfunction isProgramType(v: unknown): v is ProgramTypeEnum {\n  return Object.values(ProgramTypeEnum).includes(v as ProgramTypeEnum);\n}\nif (!isProgramType(programType)) throw new Error('invalid programType');","typeGuard":"import { ProgramTypeEnum } from '@fuel-ts/abi-typegen';\nfunction isProgramType(v: unknown): v is ProgramTypeEnum {\n  return Object.values(ProgramTypeEnum).includes(v as ProgramTypeEnum);\n}","tryCatchPattern":null,"preventionTips":["Always pass ProgramTypeEnum members, not raw strings.","Validate programType at the boundary when it comes from user input."],"tags":["typegen","invalid-input","program-type","config"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}