{"record":{"id":"467493c72ae50ddd","repo":"FuelLabs/fuels-ts","slug":"log-type-not-found","errorCode":"LOG_TYPE_NOT_FOUND","errorMessage":"Log type with logId '${logId}' doesn't exist in the ABI.","messagePattern":"Log type with logId '(.+?)' doesn't exist in the ABI\\.","errorType":"error_code","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/abi-coder/src/Interface.ts","lineNumber":66,"sourceCode":"\n    throw new FuelError(\n      ErrorCode.FUNCTION_NOT_FOUND,\n      `function ${nameOrSignatureOrSelector} not found: ${JSON.stringify(fn)}.`\n    );\n  }\n\n  // Decode the result of a function call\n  decodeFunctionResult(functionFragment: FunctionFragment | string, data: BytesLike): any {\n    const fragment =\n      typeof functionFragment === 'string' ? this.getFunction(functionFragment) : functionFragment;\n\n    return fragment.decodeOutput(data);\n  }\n\n  decodeLog(data: BytesLike, logId: string): any {\n    const loggedType = this.jsonAbiOld.loggedTypes.find((type) => type.logId === logId);\n    if (!loggedType) {\n      throw new FuelError(\n        ErrorCode.LOG_TYPE_NOT_FOUND,\n        `Log type with logId '${logId}' doesn't exist in the ABI.`\n      );\n    }\n\n    return AbiCoder.decode(this.jsonAbiOld, loggedType.loggedType, arrayify(data), 0, {\n      encoding: this.encoding,\n    });\n  }\n\n  encodeConfigurable(name: string, value: InputValue) {\n    const configurable = this.jsonAbiOld.configurables.find((c) => c.name === name);\n    if (!configurable) {\n      throw new FuelError(\n        ErrorCode.CONFIGURABLE_NOT_FOUND,\n        `A configurable with the '${name}' was not found in the ABI.`\n      );\n    }","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/abi-coder/src/Interface.ts#L48-L84","documentation":"Thrown by `Interface.decodeLog` (code `LOG_TYPE_NOT_FOUND`) when no entry in the ABI's `loggedTypes` array has a `logId` equal to the one supplied. The decoder needs the loggedType to know how to decode the log's data, so an unknown logId cannot be processed.","triggerScenarios":"Decoding a log receipt from a contract whose ABI does not declare that log (ABI/bytecode drift); using the wrong contract's ABI to decode receipts; the contract added a new `log` statement after the bindings were generated.","commonSituations":"Forgetting to regenerate bindings after adding `log()` calls in Sway; decoding receipts from one contract instance with another contract's interface; version mismatch between deployed bytecode and the ABI used in the client.","solutions":["Regenerate bindings (`fuels typegen`) from the ABI of the deployed contract and retry.","Ensure the `Interface`/contract instance used for decoding is the one that emitted the log.","Inspect `interface.jsonAbiOld.loggedTypes.map(t => t.logId)` to enumerate known logIds.","If you intentionally receive unknown logs, filter them out before decoding (check `loggedTypes.some(t => t.logId === receipt.logId)`)."],"exampleFix":"// before\nconst decoded = iface.decodeLog(receipt.data, receipt.logId);\n// after — skip logs the ABI doesn't know about\nconst known = iface.jsonAbiOld.loggedTypes.some(t => t.logId === receipt.val);\nconst decoded = known ? iface.decodeLog(receipt.data, receipt.logId) : null;","handlingStrategy":"validation","validationCode":"// filter to logs the ABI can decode before calling decodeLog\nconst known = iface.jsonAbiOld.loggedTypes.some((t) => t.logId === receipt.val);\nconst decoded = known ? iface.decodeLog(receipt.data, receipt.val) : null;","typeGuard":"function isKnownLogId(iface, logId) {\n  return iface.jsonAbiOld.loggedTypes.some((t) => t.logId === logId);\n}","tryCatchPattern":"try {\n  const v = iface.decodeLog(receipt.data, receipt.val);\n} catch (e) {\n  if (e.code === 'LOG_TYPE_NOT_FOUND') {\n    // ABI predates the contract's new log; regenerate and retry\n  }\n  throw e;\n}","preventionTips":["Regenerate bindings whenever the contract adds new `log()` statements.","Decode receipts only with the interface of the contract that emitted them.","Filter unknown logIds before decoding when consuming receipts from multiple contracts."],"tags":["abi-coder","logs","decode","abi-mismatch"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}