{"record":{"id":"15e8c4aec2c1e99d","repo":"BabylonJS/Babylon.js","slug":"you-must-define-the-outputblock-property-before-bu","errorCode":null,"errorMessage":"You must define the outputBlock property before building the node render graph","messagePattern":"You must define the outputBlock property before building the node render graph","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Node/nodeRenderGraph.ts","lineNumber":354,"sourceCode":"    private _createNodeEditor(additionalConfig?: any) {\r\n        const nodeEditorConfig: any = {\r\n            nodeRenderGraph: this,\r\n            customBlockDescriptions: NodeRenderGraph.CustomBlockDescriptions,\r\n            ...additionalConfig,\r\n        };\r\n        this.BJSNODERENDERGRAPHEDITOR.NodeRenderGraphEditor.Show(nodeEditorConfig);\r\n    }\r\n\r\n    /**\r\n     * Build the final list of blocks that will be executed by the \"execute\" method.\r\n     * It also builds the underlying frame graph unless specified otherwise.\r\n     * @param dontBuildFrameGraph If the underlying frame graph should not be built (default: false)\r\n     * @param waitForReadiness If the method should wait for the frame graph to be ready before resolving (default: true). Note that this parameter has no effect if \"dontBuildFrameGraph\" is true.\r\n     * @param setAsSceneFrameGraph If the built frame graph must be set as the scene's frame graph (default: true)\r\n     */\r\n    public async buildAsync(dontBuildFrameGraph = false, waitForReadiness = true, setAsSceneFrameGraph = true): Promise<void> {\r\n        if (!this.outputBlock) {\r\n            throw new Error(\"You must define the outputBlock property before building the node render graph\");\r\n        }\r\n\r\n        if (setAsSceneFrameGraph) {\r\n            this._scene.frameGraph = this._frameGraph;\r\n        }\r\n\r\n        this._initializeBlock(this.outputBlock);\r\n\r\n        this._frameGraph.clear();\r\n\r\n        const state = new NodeRenderGraphBuildState();\r\n\r\n        state.buildId = this._buildId;\r\n        state.verbose = this._options.verbose!;\r\n\r\n        if (this._options.autoFillExternalInputs) {\r\n            this._autoFillExternalInputs();\r\n        }\r","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Node/nodeRenderGraph.ts#L336-L372","documentation":"NodeRenderGraph.buildAsync requires an output block: it is the sink that finalizes the frame graph. Building without one would produce a graph with no visible output, so the method throws immediately.","triggerScenarios":"Calling buildAsync() (directly or via constructor, CreateDefaultAsync, replaceCameraAsync, or context-menu default-graph creation) when the outputBlock property is null/undefined.","commonSituations":"Manually assembling a node render graph and forgetting to add an output block; clearing the output block before rebuilding; JSON loading that omitted the output node.","solutions":["Create an output block and assign it: nodeRenderGraph.outputBlock = outputBlock before building","Wire your graph's final color into the output block's input","Re-add the output block if it was removed during editing/loading"],"exampleFix":"// before\nconst graph = new NodeRenderGraph(...);\ngraph.buildAsync();\n// after\nconst output = new NodeRenderGraphOutputBlock(\"output\");\ngraph.outputBlock = output;\ncolorBlock.output.connectTo(output.input);\ngraph.buildAsync();","handlingStrategy":"validation","validationCode":"if (!nodeRenderGraph.outputBlock) {\n  throw new Error('attach an output block before buildAsync()');\n}","typeGuard":"function hasOutputBlock(g) { return g.outputBlock != null; }","tryCatchPattern":"try { await nodeRenderGraph.buildAsync(); } catch (e) { if (e.message.includes('You must define the outputBlock')) { console.error('Add a NodeRenderGraphOutputBlock and wire final color to it'); } else { throw e; } }","preventionTips":["Treat output block creation as step 1 of any node render graph","When loading graphs from JSON, verify an output block exists before build","Never null out outputBlock during edits without restoring it"],"tags":["render-graph","missing-required-property"],"backgroundTag":"missing-required-property","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}