diff --git a/packages/frontend/src/components/MkAnimBg.vue b/packages/frontend/src/components/MkAnimBg.vue index 70d101a9d3..6bda74a811 100644 --- a/packages/frontend/src/components/MkAnimBg.vue +++ b/packages/frontend/src/components/MkAnimBg.vue @@ -24,8 +24,16 @@ const props = withDefaults(defineProps<{ function loadShader(gl, type, source) { const shader = gl.createShader(type); - gl.shaderSource(shader, source); - gl.compileShader(shader); + try { + gl.shaderSource(shader, source); + gl.compileShader(shader); + } catch (error) { + alert( + `failed to compile shader: ${error} ${gl.getShaderInfoLog(shader)}`, + ); + gl.deleteShader(shader); + return null; + } if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { alert(