title: Failed to execute 'uniformMatrix4fv'
body: <p>I'm very new to OpenGL and Javascript so I'm not sure what exactly is wrong. I am making a program that rotates a shape along all three axes x,y and z. I am trying to multiply my position vectors with a rotation matrix but I'm getting this error: </p>
  
  <p><code>Uncaught TypeError: Failed to execute 'uniformMatrix4fv' on 'WebGLRenderingContext': No function was found that matched the signature provided.</code></p>
  
  <p>Here is my vertex shader, I've shortened it to hide the unnecessary code which already works so I can highlight where I am having the problem. I have the multiplication here also:</p>
  
  <pre><code>attribute vec2 pos;
  uniform mat4 rotation;
  
  void main(){
  
   gl_Position = rotation*vec4(vec3(pos,0),1);
  
   gl_Position.x = pos.x*cos(shift) - pos.y*sin(shift);
   gl_Position.y = pos.y*cos(shift)  + pos.x*sin(shift);
   gl_Position.z =0.0;
   gl_Position.w =1.0;
  }
  </code></pre>
  
  <p>This is one of the rotation functions, I am doing one for each axis. The rotation matrix which is 4x4 looks like this: </p>
  
  <pre><code>function xAxis(angle){
  var c = Math.cos(angle);
  var s = Math.sin(angle);
  
  return[
  1,0,0,0,
  0,c,-s,0,
  0,s,c,0,
  0,0,0,1
  ];
  }
  </code></pre>
  
  <p>But when I try to use this command inside the draw function I get an error</p>
  
  <pre><code>gl.uniformMatrix4fv(rotationLocation, false, rotation);
  </code></pre>
  
  <p>So my question is how do I fix this error? </p>
  
  <p>EDIT: I should add that I am using a Javascript file as well as an HTML file. All the important code, so the vertex shader, fragment shader etc, is inside the Javascript file. </p>
  
  <p>EDIT 2: I should also add that the program worked fine before I added these lines of code.</p>
  
  <p>EDIT 3: Here's a <a href="https://drive.google.com/file/d/1XVtTjj-Gk3GzwdOfT1uSIX8AYtDJPsnY/view?usp=sharing" rel="nofollow noreferrer">Link to my Javascript code</a> I converted it to a text file for easier reading</p>