{"record":{"id":"f14fd5eb7661e314","repo":"freeCodeCamp/freeCodeCamp","slug":"superblock-not-found-superblock","errorCode":null,"errorMessage":"Superblock not found: ${superBlock}","messagePattern":"Superblock not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"curriculum/src/build-superblock.ts","lineNumber":385,"sourceCode":"    { superBlock, order }: { superBlock: SuperBlocks; order: number }\n  ) {\n    const blockName = block.dashedName;\n    log(`Processing block ${blockName} in superblock ${superBlock}`);\n\n    // Check if block directory exists\n    const blockContentDir = resolve(this.blockContentDir, blockName);\n    if (!existsSync(blockContentDir)) {\n      throw Error(`Block directory not found: ${blockContentDir}`);\n    }\n\n    if (block.isUpcomingChange && !SHOW_UPCOMING_CHANGES) {\n      log(`Ignoring upcoming block ${blockName}`);\n      return null;\n    }\n\n    const superOrder = getSuperOrder(superBlock);\n    if (superOrder === undefined)\n      throw Error(`Superblock not found: ${superBlock}`);\n    const meta = {\n      ...block,\n      superOrder,\n      superBlock,\n      order,\n      ...(block.chapter && { chapter: block.chapter }),\n      ...(block.module && { module: block.module })\n    };\n    const isAudited = isAuditedSuperBlock(this.lang, superBlock as SuperBlocks);\n\n    // Read challenges from directory\n    const foundChallenges = await this.readBlockChallenges(\n      blockName,\n      meta,\n      isAudited\n    );\n    log(`Found ${foundChallenges.length} challenge files in directory`);\n","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/freeCodeCamp/freeCodeCamp/blob/4289125977fa5bc4c90d7e2860bc04062a30abee/curriculum/src/build-superblock.ts#L367-L403","documentation":"Thrown while the curriculum builder processes a superblock's blocks. processBlock calls getSuperOrder(superBlock), which builds an order map from generateSuperBlockList() — the superBlockStages config in packages/shared/src/config/curriculum.ts (the Upcoming stage is only included when SHOW_UPCOMING_CHANGES is true). If the superblock name is not a key in that map, superOrder is undefined and the build aborts: the superblock being built is not registered in the shared stage list, or it is an upcoming superblock while upcoming changes are hidden.","triggerScenarios":"Building the curriculum (getChallengesForLang → buildCurriculum → SuperBlock.blocks → processBlock) with a filter or structure naming a superblock absent from superBlockStages; building a superblock that only exists in SuperBlockStage.Upcoming (full-stack-open, a2-spanish, ...) without SHOW_UPCOMING_CHANGES=true; a superblock structure or filter whose name does not match its SuperBlocks enum value.","commonSituations":"A new superblock was scaffolded (structure JSON, content directories) but never added to superBlockStages in packages/shared; local env missing SHOW_UPCOMING_CHANGES while the branch contains upcoming superblocks; a stale name left in scripts or filters after a superblock rename (e.g. v8 → v9).","solutions":["Set SHOW_UPCOMING_CHANGES=true in the environment if the superblock lives in SuperBlockStage.Upcoming.","Compare the name in the error with the SuperBlocks enum and use the exact dashed value (e.g. 'responsive-web-design-v9').","Register the new superblock in superBlockStages (packages/shared/src/config/curriculum.ts) and rebuild the shared config."],"exampleFix":"// before: superblock only listed under [SuperBlockStage.Upcoming]\n// after: also added to a visible stage\n[SuperBlockStage.Core]: [\n  SuperBlocks.RespWebDesignV9,\n  SuperBlocks.JsV9,\n  SuperBlocks.MyNewSuperBlock // added\n]","handlingStrategy":"validation","validationCode":"import { generateSuperBlockList } from '@freecodecamp/shared/config/curriculum';\n\nconst known = generateSuperBlockList({ showUpcomingChanges: true });\nif (!known.includes(superBlock)) {\n  throw new RangeError(\n    `Unknown superblock '${superBlock}'. Valid values: ${known.join(', ')}`\n  );\n}","typeGuard":"import { generateSuperBlockList, SuperBlocks } from '@freecodecamp/shared/config/curriculum';\n\nconst KNOWN = new Set<string>(\n  generateSuperBlockList({ showUpcomingChanges: true })\n);\nexport const isSuperBlock = (sb: string): sb is SuperBlocks => KNOWN.has(sb);","tryCatchPattern":"try {\n  await getChallengesForLang(lang, { superblock: [superBlock] });\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Superblock not found')) {\n    // name not in superBlockStages, or SHOW_UPCOMING_CHANGES is off\n    console.error(`${e.message} — check SHOW_UPCOMING_CHANGES and superBlockStages`);\n    process.exitCode = 1;\n  } else throw e;\n}","preventionTips":["Type every superblock reference as the SuperBlocks enum, never plain string.","When adding a superblock, update superBlockStages in the same change that adds its structure JSON.","Set SHOW_UPCOMING_CHANGES=true in local/dev environments before building upcoming curriculum."],"tags":["curriculum","build","superblock","configuration","enum"],"backgroundTag":"unregistered-enum-value","analyzedSha":"4289125977fa5bc4c90d7e2860bc04062a30abee","analyzedAt":"2026-08-24T06:46:05.087Z","schemaVersion":2},"datasetVersion":"2026-08-24T07:17:09.176Z"}