FuelLabs/fuels-ts · error · FuelError

TYPE_NOT_SUPPORTED

TYPE_NOT_SUPPORTED

Error message

Type not supported: ${type}

What it means

makeType iterates the supportedTypes registry and picks the first whose isSuitableFor({ type }) returns true for the rawAbiType.type string. If none is suitable, the Sway type is one the typegen does not implement, so it cannot emit a corresponding TypeScript type.

Source

Thrown at packages/abi-typegen/src/utils/makeType.ts:14

import { ErrorCode, FuelError } from '@fuel-ts/errors';

import type { JsonAbiType } from '../types/interfaces/JsonAbi';

import { supportedTypes } from './supportedTypes';

export function makeType(params: { rawAbiType: JsonAbiType }) {
  const { rawAbiType } = params;
  const { type } = rawAbiType;

  const TypeClass = supportedTypes.find((tc) => tc.isSuitableFor({ type }));

  if (!TypeClass) {
    throw new FuelError(ErrorCode.TYPE_NOT_SUPPORTED, `Type not supported: ${type}`);
  }

  return new TypeClass(params);
}

View on GitHub (pinned to b3f37c91ac)

Solutions

  1. Upgrade @fuel-ts/abi-typegen (and the SDK) to a release supporting the Sway type shown in the error.
  2. Remove or replace the unsupported Sway type in your contract/script/predicate source and rebuild the ABI.
  3. Check the release notes/changelog for the supported Sway type set of your SDK version.
Defensive patterns

Strategy: validation

Validate before calling

import { supportedTypes } from '@fuel-ts/abi-typegen';
function assertTypeSupported(rawAbiType: JsonAbiType) {
  if (!supportedTypes.some(tc => tc.isSuitableFor({ type: rawAbiType.type }))) {
    throw new Error(`Sway type not supported by typegen: ${rawAbiType.type}`);
  }
}

Prevention

When it happens

Trigger: An ABI declaring a Sway type not yet supported by the installed typegen (e.g. a newly introduced Sway type, an experimental/generic type); a custom malformed type string.

Common situations: SDK version older than the Sway compiler that produced the ABI; experimental Sway features; ABI from a different language targeting Fuel.

Related errors


AI-assisted analysis of FuelLabs/fuels-ts@b3f37c91ac (2026-08-12). Data as JSON: /api/errors/660d2f5461904dfa. Report an issue: GitHub.