{"record":{"id":"9551b731d2b78f81","repo":"BabylonJS/Babylon.js","slug":"error-parsing-nodes","errorCode":null,"errorMessage":"Error parsing nodes","messagePattern":"Error parsing nodes","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.ts","lineNumber":239,"sourceCode":"                        type: type.flowGraphType,\n                        eventData: true,\n                        value,\n                    };\n                });\n            }\n            this._events.push(converted);\n        }\n    }\n\n    private _parseNodes() {\n        if (!this._interactivityGraph.nodes) {\n            return;\n        }\n        for (const node of this._interactivityGraph.nodes) {\n            // some validation\n            if (typeof node.declaration !== \"number\") {\n                Logger.Error([\"No declaration found for node\", node]);\n                throw new Error(\"Error parsing nodes\");\n            }\n            const mapping = this._mappings[node.declaration];\n            if (!mapping) {\n                Logger.Error([\"No mapping found for node\", node]);\n                throw new Error(\"Error parsing nodes\");\n            }\n            if (mapping.flowGraphMapping.validation) {\n                const validationResult = mapping.flowGraphMapping.validation(node, this._interactivityGraph, this._gltf);\n                if (!validationResult.valid) {\n                    throw new Error(`Error validating interactivity node ${this._interactivityGraph.declarations?.[node.declaration].op} - ${validationResult.error}`);\n                }\n            }\n            const blocks: ISerializedFlowGraphBlock[] = [];\n            // create block(s) for this node using the mapping\n            for (const blockType of mapping.flowGraphMapping.blocks) {\n                const block = this._getEmptyBlock(blockType, mapping.fullOperationName);\n                this._parseNodeConfiguration(node, block, mapping.flowGraphMapping, blockType);\n                blocks.push(block);","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.ts#L221-L257","documentation":"Thrown in _parseNodes when an interactivity node is missing a numeric `declaration` index. Every node must reference an entry in the graph's `declarations` array by index; a missing or non-numeric declaration makes the node un-mappable to FlowGraph blocks.","triggerScenarios":"A node in `interactivity.nodes` has no `declaration` property, a null declaration, or a non-number (e.g. a string op name instead of an index) — checked via `typeof node.declaration !== \"number\"`.","commonSituations":"Hand-written or hand-edited glTF where the author put the op name directly on the node; older/incorrect exporter output; JSON schema drift between KHR_interactivity draft versions.","solutions":["Add a valid numeric `declaration` index to each node, referencing the graph's `declarations` array","If the node was meant to declare an op inline, move the op into `declarations` and reference it by index","Validate the asset against the KHR_interactivity JSON schema before loading","Re-export with a current exporter"],"exampleFix":"// before\n{ \"configuration\": {} }\n// after\n{ \"declaration\": 0, \"configuration\": {} }","handlingStrategy":"validation","validationCode":"for (const node of graph.nodes ?? []) {\n  if (typeof node.declaration !== 'number') throw new Error(`Node missing numeric declaration: ${JSON.stringify(node).slice(0, 80)}`);\n}","typeGuard":"function nodeHasDeclaration(node: IKHRInteractivity_Node): node is IKHRInteractivity_Node & { declaration: number } {\n  return typeof (node as any).declaration === 'number';\n}","tryCatchPattern":"try {\n  const parser = new InteractivityGraphToFlowGraphParser(graph, gltf);\n} catch (e) {\n  if (e.message === 'Error parsing nodes') {\n    console.warn('Interactivity node missing declaration; loading without interactivity');\n    return null;\n  }\n  throw e;\n}","preventionTips":["Always declare ops in `declarations` and reference them by numeric index from nodes","Do not hand-edit interactivity JSON; re-export from the authoring tool","Validate against the KHR_interactivity JSON schema before loading","Check for draft-version mismatches between your asset and the loader's expected schema"],"tags":["gltf","khr-interactivity","nodes","parser"],"backgroundTag":"missing-node-declaration","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}