{"record":{"id":"092f6ba27f3e0393","repo":"tinyhumansai/openhuman","slug":"meshgradient-createshader-returned-null-webgl","errorCode":null,"errorMessage":"[MeshGradient] createShader returned null — WebGL context may be lost","messagePattern":"\\[MeshGradient\\] createShader returned null — WebGL context may be lost","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/lib/meshGradient.js","lineNumber":56,"sourceCode":"              const t = new Date();\n              (t - _miniGl.lastDebugMsg > 1e3 && console.log('---'),\n                console.log(\n                  t.toLocaleTimeString() + Array(Math.max(0, 32 - e.length)).join(' ') + e + ': ',\n                  ...Array.from(arguments).slice(1)\n                ),\n                (_miniGl.lastDebugMsg = t));\n            }\n          : () => {}),\n      Object.defineProperties(_miniGl, {\n        Material: {\n          enumerable: false,\n          value: class {\n            constructor(vertexShaders, fragments, uniforms = {}) {\n              const material = this;\n              function getShaderByType(type, source) {\n                const shader = context.createShader(type);\n                if (!shader) {\n                  console.warn(\n                    '[MeshGradient] createShader returned null — WebGL context may be lost'\n                  );\n                  return null;\n                }\n                return (\n                  context.shaderSource(shader, source),\n                  context.compileShader(shader),\n                  context.getShaderParameter(shader, context.COMPILE_STATUS) ||\n                    console.error(context.getShaderInfoLog(shader)),\n                  _miniGl.debug('Material.compileShaderSource', { source: source }),\n                  shader\n                );\n              }\n              function getUniformVariableDeclarations(uniforms, type) {\n                return Object.entries(uniforms)\n                  .map(([uniform, value]) => value.getDeclaration(uniform, type))\n                  .join('\\n');\n              }","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/lib/meshGradient.js#L38-L74","documentation":"gl.createShader returned null during mesh-gradient material setup, which the code attributes to a lost WebGL context. Context loss (driver reset, resource pressure, too many contexts) invalidates the existing handle — every subsequent GL call on it fails or returns null. The renderer cannot build programs in this state; the visual freezes or goes blank until the canvas/context is recreated.","triggerScenarios":"Thrown at app/src/lib/meshGradient.js:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Listen for the webglcontextlost/restored events on the canvas and rebuild the MiniGl renderer on restoration","Reduce live WebGL contexts (fewer gradient canvases) to avoid resource-pressure loss","Driver resets cause transient loss — remounting the gradient component recreates the context","If recurrent, check GPU driver stability and webview GPU acceleration settings"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}