{"record":{"id":"e05f96b9b343077f","repo":"BabylonJS/Babylon.js","slug":"unknown-vector-class-name-classname","errorCode":null,"errorMessage":"Unknown vector class name ${className}","messagePattern":"Unknown vector class name (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FlowGraph/serialization.ts","lineNumber":78,"sourceCode":"    } else if (className === FlowGraphTypes.Vector3) {\r\n        if (flipHandedness) {\r\n            value[2] *= -1;\r\n        }\r\n        return Vector3.FromArray(value);\r\n    } else if (className === FlowGraphTypes.Vector4) {\r\n        return Vector4.FromArray(value);\r\n    } else if (className === FlowGraphTypes.Quaternion) {\r\n        if (flipHandedness) {\r\n            value[2] *= -1;\r\n            value[3] *= -1;\r\n        }\r\n        return Quaternion.FromArray(value);\r\n    } else if (className === FlowGraphTypes.Color3) {\r\n        return new Color3(value[0], value[1], value[2]);\r\n    } else if (className === FlowGraphTypes.Color4) {\r\n        return new Color4(value[0], value[1], value[2], value[3]);\r\n    } else {\r\n        throw new Error(`Unknown vector class name ${className}`);\r\n    }\r\n}\r\n\r\n/**\r\n * The default function that serializes values in a context object to a serialization object\r\n * @param key the key where the value should be stored in the serialization object\r\n * @param value the value to store\r\n * @param serializationObject the object where the value will be stored\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function defaultValueSerializationFunction(key: string, value: any, serializationObject: any) {\r\n    const className = value?.getClassName?.() ?? \"\";\r\n    if (IsVectorClassName(className) || IsMatrixClassName(className)) {\r\n        serializationObject[key] = {\r\n            value: value.asArray(),\r\n            className,\r\n        };\r\n    } else if (className === FlowGraphTypes.Integer) {\r","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FlowGraph/serialization.ts#L60-L96","documentation":"During FlowGraph deserialization, ParseVector converts serialized arrays into Vector2/Vector3/Vector4/Quaternion/Color3/Color4 based on the className stored in the serialization object. An unrecognized className means the data was written by an incompatible/older version or is corrupted.","triggerScenarios":"defaultValueParseFunction encounters a context value whose className is not one of the FlowGraphTypes vector/color names handled by ParseVector.","commonSituations":"Hand-edited or machine-generated flow graph JSON with a typo like \"vector3\", deserializing graphs saved from a newer Babylon version with new types, or corrupted serialization payloads.","solutions":["Correct the className in the serialized data to a supported FlowGraphTypes value","Re-export the flow graph from the same Babylon.js version used to deserialize it","Extend ParseVector to support the new class name if you added a custom type"],"exampleFix":"// before (serialized JSON)\n{\"className\": \"vector3\", \"value\": [1,2,3]}\n// after\n{\"className\": \"Vector3\", \"value\": [1,2,3]}","handlingStrategy":"validation","validationCode":"const KNOWN = ['Vector2','Vector3','Vector4','Quaternion','Color3','Color4'];\nif (!KNOWN.includes(className)) throw new Error(`unsupported vector className: ${className}`);","typeGuard":"function isKnownVectorClassName(c: string): c is 'Vector2'|'Vector3'|'Vector4'|'Quaternion'|'Color3'|'Color4' { return ['Vector2','Vector3','Vector4','Quaternion','Color3','Color4'].includes(c); }","tryCatchPattern":"try { value = defaultValueParseFunction(key, serialized); } catch (e) { if (e.message.startsWith('Unknown vector class name')) { console.error('Upgrade Babylon or fix serialized className'); } else { throw e; } }","preventionTips":["Keep serialization and runtime Babylon.js versions in sync","Validate className against FlowGraphTypes before deserializing custom JSON","Never hand-edit serialized className strings without checking FlowGraphTypes"],"tags":["serialization","flow-graph","version-mismatch"],"backgroundTag":"unknown-enum-value","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}