title: WebGL: INVALID_OPERATION: useProgram: program not valid
body: <p>I'm learning WebGl and trying to convert a web mining script to do elliptical curve addition. I started by replacing the working GL code with the code from vanitygen-plus, even though it does more than I need/want. I also began replacing the variables passed to the expected ones and removed a bunch of unneeded JavaScript.
  I now get the error &quot;glminer.js:54 WebGL: INVALID_OPERATION: useProgram: program not valid&quot; currently testing in chrome 91 on windows 10.
  unfortunately this doesn't help me much as it doesn't tell me what is invalid.</p>
  <pre><code>        var program = gl.createProgram();
          vShader = gl.createShader(gl.VERTEX_SHADER);
          gl.shaderSource(vShader,vShaderQuellcode);
          gl.compileShader(vShader);
          
              // Check for any compilation error
           if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) {
              console.log(gl.getShaderInfoLog(vShader));
          }
          gl.attachShader(program,vShader);
         gl.linkProgram(program);
          gl.useProgram(program); // error here
  
  </code></pre>
  <p>I would have posted shader-fs.js which is the code replaced from vanitygen-plus but it put me 7K char. over the limit</p>