{"record":{"id":"0889fb0c8fbd939a","repo":"BabylonJS/Babylon.js","slug":"error-parsing-declarations","errorCode":null,"errorMessage":"Error parsing declarations","messagePattern":"Error parsing declarations","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.ts","lineNumber":122,"sourceCode":"        if (!this._interactivityGraph.types) {\n            return;\n        }\n        for (const type of this._interactivityGraph.types) {\n            this._types.push(gltfTypeToBabylonType[type.signature]);\n        }\n    }\n\n    private _parseDeclarations() {\n        if (!this._interactivityGraph.declarations) {\n            return;\n        }\n        for (const declaration of this._interactivityGraph.declarations) {\n            // make sure we have the mapping for this operation\n            const mapping = getMappingForDeclaration(declaration);\n            // mapping is defined, because we generate an empty mapping if it's not found\n            if (!mapping) {\n                Logger.Error([\"No mapping found for declaration\", declaration]);\n                throw new Error(\"Error parsing declarations\");\n            }\n            this._mappings.push({\n                flowGraphMapping: mapping,\n                fullOperationName: declaration.extension ? declaration.op + \":\" + declaration.extension : declaration.op,\n            });\n        }\n    }\n\n    private _parseVariables() {\n        if (!this._interactivityGraph.variables) {\n            return;\n        }\n        for (const variable of this._interactivityGraph.variables) {\n            const parsed = this._parseVariable(variable);\n            // set the default values here\n            this._staticVariables.push(parsed);\n        }\n    }","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.ts#L104-L140","documentation":"Thrown by InteractivityGraphToFlowGraphParser._parseDeclarations when a declaration in the glTF KHR_interactivity graph has an operation (`op`) that getMappingForDeclaration cannot resolve to a FlowGraph block mapping. The parser maintains a table of supported operations; any declaration whose op (plus optional extension qualifier) is not in the table aborts loading. This means the asset uses an interactivity operation this Babylon.js version does not support.","triggerScenarios":"Constructing InteractivityGraphToFlowGraphParser (via the glTF loader with KHR_interactivity enabled) on an asset whose `declarations` array contains an `op` string that has no entry in the declaration mapper table, or whose `extension`-qualified op is unsupported.","commonSituations":"Assets exported with a newer KHR_interactivity operation set than the installed Babylon.js version; custom/extension operations (op namespaced by an `extension` field) not implemented; typos in op names from hand-edited glTF files.","solutions":["Upgrade @babylonjs/core and @babylonjs/loaders to the latest version, which supports more interactivity operations","Inspect the logged declaration to find the unsupported `op` and remove or replace that node in the asset","Check declarationMapper.ts to see which ops are supported and re-export the asset using only supported operations","If the op comes from an unregistered extension, verify the extension is enabled in the loader and has a registered mapping"],"exampleFix":"// before: asset declares an unsupported op\n{ \"op\": \"interaction/customHover\", \"extension\": \"EXT_my_ext\" }\n// after: upgrade Babylon OR re-export using a supported op, e.g.\n{ \"op\": \"core/Pointer/Set\" }","handlingStrategy":"validation","validationCode":"const supportedOps = new Set(Object.keys(declarationMapperTable)); // from declarationMapper\nfor (const d of graph.declarations ?? []) {\n  if (!getMappingForDeclaration(d)) throw new Error(`Unsupported interactivity op: ${d.op}`);\n}","typeGuard":"function hasMapping(d: IKHRInteractivity_Declaration): boolean {\n  return typeof d?.op === 'string' && getMappingForDeclaration(d) != null;\n}","tryCatchPattern":"try {\n  const parser = new InteractivityGraphToFlowGraphParser(graph, gltf);\n} catch (e) {\n  if (e.message === 'Error parsing declarations') {\n    console.warn('Asset uses unsupported interactivity operations; loading without interactivity');\n    return null; // fall back to non-interactive load\n  }\n  throw e;\n}","preventionTips":["Keep Babylon.js loaders/core packages up to date with the exporter version","Validate glTF assets with a KHR_interactivity-aware validator before loading","Only author assets with ops listed in declarationMapper.ts","Check the console Logger.Error output to identify unsupported op names early"],"tags":["gltf","khr-interactivity","parser","unsupported-operation"],"backgroundTag":"unsupported-operation-declaration","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}