{"record":{"id":"7a49e10bc893f367","repo":"hcengineering/platform","slug":"unsupported-attribute-type-basetype-class","errorCode":null,"errorMessage":"Unsupported attribute type: ${baseType._class}","messagePattern":"Unsupported attribute type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/huly/cards.ts","lineNumber":840,"sourceCode":"        case core.class.TypeString:\n          fieldType = StringFieldType\n          break\n        case core.class.TypeNumber:\n          fieldType = NumberFieldType\n          break\n        case core.class.TypeBoolean:\n          fieldType = BooleanFieldType\n          break\n        case core.class.RefTo:\n          fieldType = PathFieldType\n          break\n        case core.class.EnumOf: {\n          const enumValues = this.metadataRegistry.getEnumValues(baseType.of)\n          fieldType = new OneOfFieldType(enumValues)\n          break\n        }\n        default:\n          throw new Error(`Unsupported attribute type: ${baseType._class}`)\n      }\n\n      optionalFields.set(label, {\n        type: fieldType,\n        isArray\n      })\n    }\n\n    // Add fields for relations (and from master tag, and from tags)\n    const allRelations = new Map([...masterTagAssociaions, ...tagAssociations])\n    for (const [label, relation] of allRelations.entries()) {\n      optionalFields.set(label, {\n        type: PathFieldType,\n        isArray: relation.type === 'N:N' || (relation.type === '1:N' && relation.field === 'docA')\n      })\n    }\n\n    // Add special fields","sourceCodeStart":822,"sourceCodeEnd":858,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/huly/cards.ts#L822-L858","documentation":"Thrown in the CardsProcessor's attribute-to-form-field conversion when a master tag attribute's base type class is not among the supported set (string, number, boolean, enum, etc.). EnumOf and other known wrappers are handled; any other core type class (or one from a plugin) falls through to default.","triggerScenarios":"A master tag defines an attribute whose type resolves to an unsupported base _class (e.g. a plugin-specific type class, or a core type the converter doesn't cover like a rich-text/object type), encountered while building form fields for the tag.","commonSituations":"Attributes defined with types imported from other Huly plugins; importer not updated for a core type added in a newer platform version; typos in type class names resulting in an unknown class.","solutions":["Change the attribute's declared type to one of the supported base classes handled by the converter.","Upgrade or patch the importer to add a case mapping the type class to a FieldType (e.g. new TextFieldType()).","Remove attributes with unsupported types from the master tag definition."],"exampleFix":"// before (in convertToFieldType switch)\ndefault:\n  throw new Error(`Unsupported attribute type: ${baseType._class}`)\n// after — add a case\ncase core.class.TypeString:\n  fieldType = new TextFieldType()\n  break\ncase core.class.TypeRecord:\n  fieldType = new TextFieldType() // serialize as text\n  break\ndefault:\n  throw new Error(`Unsupported attribute type: ${baseType._class}`)","handlingStrategy":"validation","validationCode":"const SUPPORTED_ATTR_BASE_TYPES = [core.class.TypeString, core.class.TypeNumber, core.class.TypeBoolean, core.class.EnumOf] // match converter's switch\nfunction validateAttrTypes(attrs: { props: { type: { _class: string; of?: { _class: string } } } }[]): string[] {\n  return attrs\n    .filter(a => {\n      const t = a.props.type\n      const base = t._class === core.class.ArrOf ? t.of?._class : t._class\n      return base === undefined || !SUPPORTED_ATTR_BASE_TYPES.includes(base)\n    })\n    .map(a => a.props.name)\n}","typeGuard":"function isSupportedAttrBaseType(cls: string): boolean {\n  return [core.class.TypeString, core.class.TypeNumber, core.class.TypeBoolean, core.class.EnumOf].includes(cls as any)\n}","tryCatchPattern":"try {\n  await processor.buildFields(masterTag)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unsupported attribute type:')) {\n    const cls = e.message.replace('Unsupported attribute type: ', '')\n    console.error(`Attribute base type ${cls} has no FieldType mapping — change the type or extend the converter`)\n  } else throw e\n}","preventionTips":["Restrict master-tag attribute types to those the importer's field converter supports.","Upgrade the importer in lockstep with platform versions that add new core types.","Test-import a sample master tag for each attribute type you use."],"tags":["importer","type-mapping","attribute-types"],"backgroundTag":"unsupported-type-mapping","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}