{"record":{"id":"057743685ea5307c","repo":"BabylonJS/Babylon.js","slug":"unknown-block-name-blockname","errorCode":null,"errorMessage":"Unknown block name ${blockName}","messagePattern":"Unknown block name (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FlowGraph/Blocks/flowGraphBlockFactory.ts","lineNumber":426,"sourceCode":"        case FlowGraphBlockNames.AudioSoundEndedEvent:\n            return async () => await _LoadBlock(import(\"./Event/flowGraphSoundEndedEventBlock.pure\"), \"FlowGraphSoundEndedEventBlock\");\n        case FlowGraphBlockNames.AudioGetVolume:\n            return async () => await _LoadBlock(import(\"./Data/Audio/flowGraphGetSoundVolumeBlock.pure\"), \"FlowGraphGetSoundVolumeBlock\");\n        case FlowGraphBlockNames.AudioIsSoundPlaying:\n            return async () => await _LoadBlock(import(\"./Data/Audio/flowGraphIsSoundPlayingBlock.pure\"), \"FlowGraphIsSoundPlayingBlock\");\n        default:\n            // check if the block is a custom block\n            if (CustomBlocks[blockName]) {\n                return CustomBlocks[blockName];\n            }\n            // Fallback: O(1) reverse lookup by short name (e.g. \"FlowGraphGLTFDataProvider\" → \"KHR_interactivity/FlowGraphGLTFDataProvider\")\n            if (!blockName.includes(\"/\")) {\n                const fullKey = ShortNameToFullKey[blockName];\n                if (fullKey && CustomBlocks[fullKey]) {\n                    return CustomBlocks[fullKey];\n                }\n            }\n            throw new Error(`Unknown block name ${blockName}`);\n    }\n}\n","sourceCodeStart":408,"sourceCodeEnd":429,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FlowGraph/Blocks/flowGraphBlockFactory.ts#L408-L429","documentation":"blockFactory resolves block names through known registries (CustomBlocks and ShortNameToFullKey). When the name has no '/' path form and is not found in the short-name map or custom blocks registry, it throws 'Unknown block name <blockName>'. The requested block simply isn't registered in this runtime.","triggerScenarios":"Calling blockFactory('FlowGraphFooBlock', config) where the block was never registered (RegisterFlowGraphFooBlock not called), or the name is misspelled/uses the wrong casing.","commonSituations":"Forgetting to import side-effect modules (e.g. \"@babylonjs/core/FlowGraph/Blocks\") that register blocks; custom blocks registered under a different key; graphs authored in a different Babylon version referencing renamed blocks.","solutions":["Import the block's module (side-effect import) so its Register function runs before blockFactory is used","Check the exact block name spelling/casing against ShortNameToFullKey","If it's a custom block, register it via the custom-block registration API before parsing the graph"],"exampleFix":"// before\nconst block = await blockFactory('FlowGraphSendCustomEventBlock', cfg); // unknown\n// after\nimport \"@babylonjs/core/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock\";\nconst block = await blockFactory('FlowGraphSendCustomEventBlock', cfg);","handlingStrategy":"try-catch","validationCode":"if (!(blockName in ShortNameToFullKey) && !(blockName in CustomBlocks)) {\n  throw new Error('Block not registered: ' + blockName);\n}","typeGuard":null,"tryCatchPattern":"try { block = await blockFactory(name, cfg); } catch (e) { if (e.message.startsWith('Unknown block name')) { console.warn('Skipping unregistered block', name); return null; } throw e; }","preventionTips":["Import block side-effect modules before parsing graphs","Verify block name spelling/casing against ShortNameToFullKey","Register custom blocks before graph load; document required imports for team members"],"tags":["flow-graph","registration","unknown-identifier"],"backgroundTag":"block-not-registered","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}