{"record":{"id":"17f2882f94b154f8","repo":"FuelLabs/fuels-ts","slug":"invalid-component-17f288","errorCode":"INVALID_COMPONENT","errorMessage":"The Vec type provided is missing or has a malformed 'buf' component.","messagePattern":"The Vec type provided is missing or has a malformed 'buf' component\\.","errorType":"exception","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/abi-coder/src/utils/json-abi.ts","lineNumber":91,"sourceCode":" */\nexport const findNonVoidInputs = (\n  abi: JsonAbiOld,\n  inputs: readonly JsonAbiArgument[]\n): JsonAbiArgument[] => inputs.filter((input) => findTypeById(abi, input.type).type !== VOID_TYPE);\n\n/**\n * Find the vector buffer argument in a list of components.\n *\n * @param components - the list of components to search\n * @returns the vector buffer argument\n */\nexport const findVectorBufferArgument = (\n  components: readonly ResolvedAbiType[]\n): JsonAbiArgument => {\n  const bufferComponent = components.find((c) => c.name === 'buf');\n  const bufferTypeArgument = bufferComponent?.originalTypeArguments?.[0];\n  if (!bufferComponent || !bufferTypeArgument) {\n    throw new FuelError(\n      ErrorCode.INVALID_COMPONENT,\n      `The Vec type provided is missing or has a malformed 'buf' component.`\n    );\n  }\n  return bufferTypeArgument;\n};\n","sourceCodeStart":73,"sourceCodeEnd":98,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/abi-coder/src/utils/json-abi.ts#L73-L98","documentation":"findVectorBufferArgument locates the `buf` component of a Vec type and reads its first originalTypeArgument (the element type). If either the `buf` component is absent or its originalTypeArguments[0] is missing, the Vec cannot be decoded because its element type is unknown.","triggerScenarios":"ABI declares a Vec type whose components do not include a `buf` entry, or whose `buf` entry lacks originalTypeArguments. Typically a structurally malformed Vec entry produced by tooling or hand-editing.","commonSituations":"ABI exported from an older/newer compiler that shapes Vec differently; manually constructed Vec type without the buf wrapper; ABI corruption in transit.","solutions":["Open the ABI and confirm Vec types have a component named `buf` with a non-empty originalTypeArguments array.","Regenerate the ABI with the Sway compiler version matching the SDK.","Validate Vec entries programmatically before constructing an Interface."],"exampleFix":"// before (malformed)\n{ \"type\": \"Vec\", \"components\": [ { \"name\": \"buf\", \"type\": \"Vec\", \"typeArguments\": [] } ] }\n\n// after\n{ \"type\": \"Vec\", \"components\": [ { \"name\": \"buf\", \"type\": \"RawVec\", \"typeArguments\": [ { \"name\": \"T\", \"type\": \"u64\", \"typeArguments\": [] } ] } ] }","handlingStrategy":"validation","validationCode":"function validateVecComponents(abi: JsonAbi) {\n  for (const t of abi.types) {\n    if (t.type === 'Vec') {\n      const buf = (t.components ?? []).find(c => c.name === 'buf');\n      if (!buf || !buf.originalTypeArguments?.length) {\n        throw new Error(`Vec typeId ${t.typeId} has missing/malformed buf component`);\n      }\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a Sway compiler version compatible with your SDK so Vec components are well-formed.","Validate Vec/buf structure before constructing an Interface.","Avoid hand-editing Vec entries in the ABI."],"tags":["abi","invalid-component","vec","abi-validation"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}