BabylonJS/Babylon.js · error

Could not deserialize input block, unknown input type

Error message

Could not deserialize input block, unknown input type

What it means

InputBlockDeserializer rebuilds an InputBlock by switching on serializedBlock.data.inputType against the supported ConnectionPointType values (Boolean, Float, Texture, Color3, Color4, Vector2). If the inputType string in the serialized JSON matches none of these cases, inputBlock remains undefined and this error is thrown. It guards the V1 deserialization pipeline against corrupt or forward-incompatible data.

Source

Thrown at packages/dev/smartFilters/src/blockFoundation/inputBlock.deserializer.ts:71

            break;
        case ConnectionPointType.Color4:
            {
                inputBlock = new InputBlock(smartFilter, serializedBlock.name, ConnectionPointType.Color4, blockData.value);
            }
            break;
        case ConnectionPointType.Vector2:
            {
                inputBlock = new InputBlock(smartFilter, serializedBlock.name, ConnectionPointType.Vector2, blockData.value);
            }
            break;
    }
    if (inputBlock) {
        inputBlock.appMetadata = blockData.appMetadata;

        return inputBlock;
    }

    throw new Error("Could not deserialize input block, unknown input type");
}

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Check the data.inputType string in the serialized JSON against the supported ConnectionPointType values.
  2. Upgrade @babylonjs/smartFilters (and core) to a version that supports the input type in the file.
  3. Re-export/re-save the filter from a version that writes compatible inputType values, or fix the JSON manually.

Example fix

// before
{ "name": "myInput", "blockType": "InputBlock", "data": { "inputType": "Vector3", "value": [0,0,0] } }
// after (downgrade to a supported type or upgrade the library)
{ "name": "myInput", "blockType": "InputBlock", "data": { "inputType": "Vector2", "value": [0,0] } }
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = new Set(["Boolean", "Float", "Texture", "Color3", "Color4", "Vector2"]);
if (block.blockType === "InputBlock" && !SUPPORTED.has(block.data?.inputType)) {
  throw new Error(`Unsupported inputType: ${block.data?.inputType}`);
}

Type guard

function isSupportedInputType(t: unknown): t is ConnectionPointType {
  return typeof t === "string" && Object.values(ConnectionPointType).includes(t as ConnectionPointType);
}

Try / catch

try {
  await SmartFilter.DeserializeAsync(...);
} catch (e) {
  if (e.message.includes("unknown input type")) {
    // surface which inputType failed and prompt for library upgrade
  } else throw e;
}

Prevention

When it happens

Trigger: Calling SmartFilter deserialization on JSON whose data.inputType is misspelled, empty, or was produced by a newer version supporting a ConnectionPointType (e.g. Vector3/Matrix) this version does not know.

Common situations: Loading a saved filter created in a newer Babylon.js/smartFilters version; hand-edited or corrupted .json filter files; a schema migration that renamed inputType values.

Related errors


AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30). Data as JSON: /api/errors/c5caf2bb777ca8ba. Report an issue: GitHub.