{"record":{"id":"0b6873ef9d28ac72","repo":"BabylonJS/Babylon.js","slug":"pass-pass-name-is-not-valid-errmsg","errorCode":null,"errorMessage":"Pass \"${pass.name}\" is not valid. ${errMsg}","messagePattern":"Pass \"(.+?)\" is not valid\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/frameGraphTask.ts","lineNumber":168,"sourceCode":"    /** @internal */\r\n    public _addPass(pass: IFrameGraphPass, disabled: boolean) {\r\n        if (disabled) {\r\n            this._passesDisabled.push(pass);\r\n        } else {\r\n            this._passes.push(pass);\r\n        }\r\n    }\r\n\r\n    /** @internal */\r\n    public _checkTask() {\r\n        let outputTexture: Nullable<Nullable<InternalTexture>[]> = null;\r\n        let outputDepthTexture: Nullable<InternalTexture> = null;\r\n        let outputObjectList: FrameGraphObjectList | undefined;\r\n\r\n        for (const pass of this._passes) {\r\n            const errMsg = pass._isValid();\r\n            if (errMsg) {\r\n                throw new Error(`Pass \"${pass.name}\" is not valid. ${errMsg}`);\r\n            }\r\n            if (FrameGraphRenderPass.IsRenderPass(pass)) {\r\n                const handles = Array.isArray(pass.renderTarget) ? pass.renderTarget : [pass.renderTarget];\r\n                outputTexture = [];\r\n                for (const handle of handles) {\r\n                    if (handle !== undefined) {\r\n                        outputTexture.push(this._frameGraph.textureManager.getTextureFromHandle(handle));\r\n                    }\r\n                }\r\n                outputDepthTexture = pass.renderTargetDepth !== undefined ? this._frameGraph.textureManager.getTextureFromHandle(pass.renderTargetDepth) : null;\r\n            } else if (FrameGraphObjectListPass.IsObjectListPass(pass)) {\r\n                outputObjectList = pass.objectList;\r\n            }\r\n        }\r\n\r\n        let disabledOutputTexture: Nullable<Nullable<InternalTexture>[]> = null;\r\n        let disabledOutputTextureHandle: (FrameGraphTextureHandle | undefined)[] = [];\r\n        let disabledOutputDepthTexture: Nullable<InternalTexture> = null;\r","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/frameGraphTask.ts#L150-L186","documentation":"FrameGraphTask._checkTask() validates each pass created by a task's record() by calling pass._isValid(); if a pass reports an error message, the task throws during frameGraph.build(). This instance validates the ENABLED passes list, typically reporting missing/invalid render targets or unset required pass properties.","triggerScenarios":"Calling frameGraph.build() where a task's main (enabled) pass _isValid() returns a non-empty error — e.g. a render pass with an undefined renderTarget, a pass referencing a texture handle that can't be resolved, or a pass lacking an execute function setup.","commonSituations":"Custom tasks creating passes without setting renderTarget; tasks whose input texture assignments were forgotten so their passes hold undefined handles; a pass whose dependency texture was removed during graph refactoring.","solutions":["Read errMsg in the thrown message to identify which pass and what check failed.","Set pass.renderTarget (via pass.setRenderTarget) to valid texture handles in your task's record().","Ensure all of the task's texture inputs are assigned before build() so passes resolve valid handles.","Implement/fix _isValid() in custom pass subclasses so it returns null when the pass is fully configured."],"exampleFix":"// before\npublic record() {\n  const pass = this._frameGraph.addRenderPass(this.name);\n  // renderTarget never set -> _isValid() fails\n}\n// after\npublic record() {\n  const pass = this._frameGraph.addRenderPass(this.name);\n  pass.setRenderTarget(this.targetTexture);\n  pass.setExecuteFunc((ctx) => { /* ... */ });\n}","handlingStrategy":"validation","validationCode":"// before build(), ensure every enabled pass of each task has a render target\nfor (const task of tasks) {\n  for (const pass of task._passes) {\n    if (FrameGraphRenderPass.IsRenderPass(pass) && pass.renderTarget === undefined) {\n      throw new Error(`Pass ${pass.name} has no render target`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  frameGraph.build();\n} catch (e) {\n  const m = String(e.message).match(/Pass \"(.+)\" is not valid\\. (.+)/);\n  if (m) {\n    console.error(`Fix pass ${m[1]}: ${m[2]}`);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Always call pass.setRenderTarget(...) in record() before finishing.","Assign all task texture inputs before build(); parse the errMsg to locate the broken pass."],"tags":["babylonjs","framegraph","pass-validation","build"],"backgroundTag":"pass-validation-failed","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}