{"record":{"id":"7977cf176818f914","repo":"FuelLabs/fuels-ts","slug":"type-not-found","errorCode":"TYPE_NOT_FOUND","errorMessage":"Type with typeId '${typeId}' doesn't exist in the ABI.","messagePattern":"Type with typeId '(.+?)' doesn't exist in the ABI\\.","errorType":"exception","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/abi-coder/src/utils/json-abi.ts","lineNumber":58,"sourceCode":"    throw new FuelError(\n      ErrorCode.FUNCTION_NOT_FOUND,\n      `Function with name '${name}' doesn't exist in the ABI`\n    );\n  }\n  return fn;\n};\n\n/**\n * Find a type by its typeId in the ABI.\n *\n * @param abi - the JsonAbi object\n * @param typeId - the typeId of the type to find\n * @returns the JsonAbi type object\n */\nexport const findTypeById = (abi: JsonAbiOld, typeId: number): JsonAbiType => {\n  const type = abi.types.find((t) => t.typeId === typeId);\n  if (!type) {\n    throw new FuelError(\n      ErrorCode.TYPE_NOT_FOUND,\n      `Type with typeId '${typeId}' doesn't exist in the ABI.`\n    );\n  }\n  return type;\n};\n\n/**\n * Find all non-void inputs in a list of inputs.\n * i.e. all inputs that are not of the type '()'.\n *\n * @param abi - the JsonAbi object\n * @param inputs - the list of inputs to filter\n * @returns the list of non-void inputs\n */\nexport const findNonVoidInputs = (\n  abi: JsonAbiOld,\n  inputs: readonly JsonAbiArgument[]","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/abi-coder/src/utils/json-abi.ts#L40-L76","documentation":"findTypeById searches the OLD-format ABI's types array (JsonAbiOld) for an entry whose typeId matches. A miss indicates a dangling type reference: some other ABI entry points at a typeId that has no corresponding definition, so type resolution cannot continue.","triggerScenarios":"Loading a JsonAbiOld whose types[] is missing a typeId referenced by a function input/output or by another type's components/typeArguments; corrupt or partially-truncated ABI; mixing type fragments from different ABIs.","commonSituations":"ABI hand-edited and a type removed while still referenced; ABI produced by a tool that emitted typeId gaps; converting a new-format ABI to old-format incorrectly.","solutions":["Inspect the ABI's types[] for the missing typeId noted in the error message.","Regenerate the ABI from Sway source with forc to restore consistency.","Validate that every typeId referenced across the ABI exists in types[] before loading."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function validateTypeIds(abi: JsonAbiOld) {\n  const ids = new Set(abi.types.map(t => t.typeId));\n  const dangling: number[] = [];\n  const visit = (t: JsonAbiType) => {\n    for (const c of t.components ?? []) {\n      if (typeof c.typeId === 'number' && !ids.has(c.typeId)) dangling.push(c.typeId);\n    }\n  };\n  abi.types.forEach(visit);\n  if (dangling.length) throw new Error('dangling typeIds: ' + dangling.join(', '));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate ABIs with forc to keep types[] internally consistent.","Never delete entries from a JSON ABI without checking references.","Validate typeId integrity before loading an externally-sourced ABI."],"tags":["abi","type-not-found","abi-validation","json-abi-old"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}