glDrawArrays is failing with GL_INVALID_ENUM I'm on OpenGL ES 3.0 using Mesa 17.0.3. When calling 
glDrawArrays(GL_TRIANGLE_FAN, 0, 4), 
glGetError() returns GL_INVALID_ENUM. 

I have no idea what's causing it and https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glDrawArrays.xhtml is claiming that GL_TRIANGLE_FAN is an accepted value for mode.

I'm checking for GL errors immediately before the call, and everything's fine then.
I used MESA_DEBUG=1 (Debugging Tips | mesa3d.org, Environment Variables | mesa3d.org) and found out that glEnable(TEXTURE_2D) was causing the error.

I don't know why it only got triggered on the glDrawArrays (maybe weird bindings) but when I removed that call it no longer failed with GL_INVALID_ENUM.