{"record":{"id":"33769995c741d637","repo":"hcengineering/platform","slug":"unknown-space-class-spaceconfig-class-in-spac","errorCode":null,"errorMessage":"Unknown space class ${spaceConfig.class} in ${spaceName}","messagePattern":"Unknown space class (.+?) in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/huly/huly.ts","lineNumber":401,"sourceCode":"\n          case documents.class.OrgSpace: {\n            const orgSpace = await this.processOrgSpace(spaceConfig as HulyOrgSpaceSettings)\n            builder.addOrgSpace(spacePath, orgSpace)\n            if (fs.existsSync(spacePath) && fs.statSync(spacePath).isDirectory()) {\n              await this.processControlledDocumentsRecursively(builder, spacePath, spacePath)\n            }\n            break\n          }\n\n          case core.class.Enum:\n          case core.class.Association:\n          case card.class.MasterTag: {\n            this.logger.log(`Skipping ${spaceName}: will be processed later`)\n            break\n          }\n\n          default: {\n            throw new Error(`Unknown space class ${spaceConfig.class} in ${spaceName}`)\n          }\n        }\n      } catch (error) {\n        const message = error instanceof Error ? error.message : String(error)\n        throw new Error(`Invalid space configuration in ${spaceName}: ${message}`)\n      }\n    }\n\n    const { docs, mixins, updates, files } = await this.cardsProcessor.processDirectory(folderPath)\n\n    const ws = builder.build()\n    ws.unifiedDocs = {\n      docs: Array.from(docs.values()).flat(),\n      mixins: Array.from(mixins.values()).flat(),\n      updates: Array.from(updates.values()).flat(),\n      files: Array.from(files.values())\n    }\n    return ws","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/huly/huly.ts#L383-L419","documentation":"During Huly workspace import, processImportFolder reads each top-level .yaml file as a space configuration and dispatches on its `class` field. Only a fixed set of classes is supported: tracker Project, document Teamspace, documents OrgSpace, plus Enum/Association/MasterTag (which are skipped for later processing). If the YAML declares any other class value, the importer cannot map it to a known space type and throws this error.","triggerScenarios":"Calling workspaceData/import on a Huly export folder where a *.yaml space config file has a `class:` value that is not tracker.class.Project, document.class.Teamspace, documents.class.OrgSpace, core.class.Enum, core.class.Association, or card.class.MasterTag — e.g. a typo, an older/newer export format, or a hand-edited class name.","commonSituations":"Hand-editing space YAML files and mistyping the class; importing a Huly export produced by a different version whose class identifiers changed; copying a YAML from another tool that uses different class names; leaving a leftover or experimental config file in the folder.","solutions":["Open the offending <spaceName>.yaml in the import folder and check the `class:` field","Set `class` to one of the supported values (Project, Teamspace, OrgSpace) or correct the identifier to match the Huly class from the same version that produced the export","Re-export from Huly with a matching importer version so class identifiers align","If the file is not actually a space config, remove the `class` field entirely (the importer will skip it with a log message instead of throwing)","Delete the stale/irrelevant YAML file from the import folder"],"exampleFix":"// before (spaceName.yaml)\nclass: tracker.class.Projet\ntitle: My Project\n// after\nclass: tracker.class.Project\ntitle: My Project","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['tracker.class.Project','document.class.Teamspace','documents.class.OrgSpace','core.class.Enum','core.class.Association','card.class.MasterTag']\nfor (const f of fs.readdirSync(folder).filter(f => f.endsWith('.yaml') && f !== 'settings.yaml')) {\n  const cfg = yaml.load(fs.readFileSync(path.join(folder, f), 'utf8'))\n  if (cfg?.class !== undefined && !SUPPORTED.includes(cfg.class)) {\n    console.error(`${f}: unsupported class ${cfg.class}`)\n    process.exitCode = 1\n  }\n}","typeGuard":"function isKnownSpaceClass(c: unknown): c is HulySpaceSettings['class'] {\n  return typeof c === 'string' && ['tracker.class.Project','document.class.Teamspace','documents.class.OrgSpace','core.class.Enum','core.class.Association','card.class.MasterTag'].includes(c)\n}","tryCatchPattern":"try {\n  await importer.workspaceData(folder)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Invalid space configuration')) {\n    console.error('Bad space config:', e.message)\n  } else throw e\n}","preventionTips":["Never hand-edit the `class:` field of exported space YAML files","Use the same importer version as the Huly version that produced the export","Lint all *.yaml configs against the HulySpaceSettings schema before importing","Keep non-space files out of the import root folder"],"tags":["importer","yaml-config","unsupported-value"],"backgroundTag":"unknown-space-class","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}