{"record":{"id":"fa2ddc4295edb975","repo":"BabylonJS/Babylon.js","slug":"noderendergraphinputblock-external-input-this","errorCode":null,"errorMessage":"NodeRenderGraphInputBlock: External input \"${this.name}\" is not set","messagePattern":"NodeRenderGraphInputBlock: External input \"(.+?)\" is not set","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Node/Blocks/inputBlock.pure.ts","lineNumber":249,"sourceCode":"    }\r\n\r\n    protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n        super._buildBlock(state);\r\n\r\n        if (this.isExternal) {\r\n            if (this.isBackBuffer()) {\r\n                this.output.value = backbufferColorTextureHandle;\r\n            } else if (this.isBackBufferDepthStencilAttachment()) {\r\n                this.output.value = backbufferDepthStencilTextureHandle;\r\n            } else if (this.isCamera()) {\r\n                this.output.value = this.getTypedValue<Camera>();\r\n            } else if (this.isObjectList()) {\r\n                this.output.value = this.getTypedValue<FrameGraphObjectList>();\r\n            } else if (this.isShadowLight()) {\r\n                this.output.value = this.getTypedValue<IShadowLight>();\r\n            } else {\r\n                if (this._storedValue === undefined || this._storedValue === null) {\r\n                    throw new Error(`NodeRenderGraphInputBlock: External input \"${this.name}\" is not set`);\r\n                }\r\n                const texture = this.getInternalTextureFromValue();\r\n                if (texture) {\r\n                    this.output.value = this._frameGraph.textureManager.importTexture(this.name, texture, this.output.value as FrameGraphTextureHandle);\r\n                }\r\n            }\r\n            return;\r\n        }\r\n\r\n        if ((this.type & NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer) !== 0) {\r\n            const textureCreateOptions = this.creationOptions;\r\n\r\n            if (!textureCreateOptions) {\r\n                throw new Error(`NodeRenderGraphInputBlock: Creation options are missing for texture \"${this.name}\"`);\r\n            }\r\n\r\n            this.output.value = this._frameGraph.textureManager.createRenderTargetTexture(this.name, textureCreateOptions);\r\n        }\r","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Node/Blocks/inputBlock.pure.ts#L231-L267","documentation":"A NodeRenderGraphInputBlock in external-input mode must have its value stored via setValue before the graph is built. If _storedValue is undefined or null at build time, _buildBlock throws because there is no data to feed downstream blocks.","triggerScenarios":"Building the render graph without calling inputBlock.setValue(...); the stored value was cleared or never assigned for a non-texture, non-object-list, non-light input.","commonSituations":"Adding an input block to pass a texture/lut/camera-external resource but forgetting setValue; renaming variables so the setValue call is skipped; building the graph before the resource is created.","solutions":["Call inputBlock.setValue(value) before nodeRenderGraph.buildAsync()","Ensure the resource creation happens prior to graph build and is passed to the block","If the input may be absent, don't build the block or provide a default value"],"exampleFix":"// before\nconst input = new NodeRenderGraphInputBlock(\"myTexture\");\ngraph.buildAsync();\n// after\nconst input = new NodeRenderGraphInputBlock(\"myTexture\");\ninput.setValue(myTexture);\ngraph.buildAsync();","handlingStrategy":"validation","validationCode":"if (inputBlock._storedValue === undefined || inputBlock._storedValue === null) {\n  throw new Error(`set external input '${inputBlock.name}' before build`);\n}","typeGuard":"function hasStoredValue(b) { return b._storedValue !== undefined && b._storedValue !== null; }","tryCatchPattern":"try { graph.buildAsync(); } catch (e) { if (e.message.includes('External input') && e.message.includes('is not set')) { console.error('Call setValue() on input blocks before building'); } else { throw e; } }","preventionTips":["Call setValue() on every external input block immediately after creation","Build the graph only after all external resources exist","Keep input block creation and value assignment adjacent in code"],"tags":["render-graph","missing-value","initialization-order"],"backgroundTag":"value-not-initialized","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}