My texture is not rendering properly in WebGL

So I was trying to make a render function and I ran into a problem that I have been pulling my hair out over trying to find the source of. The DrawElements function doesn’t execute yet when I try to use it neither does the texturebind function. However,no other error and error checks pop up.The texture loads correctly and stuff.In the main.js,the mainmenu texture loads correctly but when it goes into the Gilgamesh rendering one,not even the background is drawn it’s pure white.All of the console.log checks are passed too.
The Texturebind function is:

        gl.activeTexture(WhichTextureunit);
        gl.bindTexture(gl.TEXTURE_2D, texture);
        var uSampler = gl.getUniformLocation(shaderProgram, usamplerString);
        if(uSampler === null){
            console.log("uSampler not found");
            throw new Error("USampler not found");
        }
        gl.uniform1i(uSampler, Textureunitinint);
    };

The Render function:

Gilgamesh.prototype.RenderPick = function (sprite, texturemanager, gl) {
        if(sprite === "Stand"){
                if(gl.useProgram(shaderProgram) === null){
                    console.log("Hawk Tuah");
                    throw new Error("shader program not able to use");
                }
                if(texturemanager.texturebind(gl, Gilgameshrightneutralhead, shaderProgram, "Textures1", gl.TEXTURE1, 1)){
                    console.log("Bind?");
                }
                this.Imageselect = 0;
                gl.uniform2f(DieOffset, this.Headoffset[0], this.Headoffset[1]);
                gl.uniform1i(Imageselectuniformlocation, this.Imageselect);
                gl.activeTexture(gl.TEXTURE1);
                console.log("Texture:", Gilgameshrightneutralhead);
                gl.bindTexture(gl.TEXTURE_2D, Gilgameshrightneutralhead);
                if (gl.getError() !== gl.NO_ERROR) {
                    console.error("WebGL Error occurred");
                }
                gl.drawElements(gl.TRIANGLES, this.Indices.length, gl.UNSIGNED_SHORT, 0);
        }
    };

The main.js rendering part:

if (Mainmenu === true) { //replace that with real domain when real domain exists
    var MainmenuTexture = textureManager.TextureLoad(gl, "https://localhost:8080/textures/Main menu map.png", 0, 441, 361, function () {
        gl.useProgram(shaderProgram);
        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
        textureManager.initTextureBuffer2DVec2(gl, ZOTZTThimagevertices, shaderProgram, "a_texcoord");
        textureManager.texturebind(gl, MainmenuTexture, shaderProgram, "u_texture", gl.TEXTURE0,0);
        var TransformMatrix = gl.getUniformLocation(shaderProgram, "transform");
        var scaleMatrix = [2.0, 0, 0, 0, 0, 2.0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
        gl.uniformMatrix4fv(TransformMatrix, false, scaleMatrix);
        // Step 5: Get the location of the `coordinates` attribute of the vertex shader
        var coordinates = gl.getAttribLocation(shaderProgram, "coordinates");
        gl.vertexAttribPointer(coordinates, 2, gl.FLOAT, false, 8, 0);
        var DieOffset = gl.getUniformLocation(shaderProgram, "Offset");
        gl.uniform2f(DieOffset, Offsett[0], Offsett[1]);
        gl.enableVertexAttribArray(coordinates);
        gl.useProgram(shaderProgram);
            gl.viewport(0, 0, canvas.width, canvas.height);
            gl.clearColor(0.0, 0.5, 0.5, 1.0);
            console.log("down in the west texas town of El Paso");
            gl.enable(gl.DEPTH_TEST);
            if (gl.clear(gl.COLOR_BUFFER_BIT) === null)
                throw new Error("uncleared");
            console.log("I fell in love with a Mexican girl");
            gl.activeTexture(gl.TEXTURE0);
            console.log("Running and shooting");
            gl.bindTexture(gl.TEXTURE_2D, MainmenuTexture);
            console.log("Fenina has found me");

            if(gl.drawElements(gl.TRIANGLES, ZOTZTThindices.length, gl.UNSIGNED_SHORT, 0)){
                console.log("jdjdosj");
            }
        console.log("before gilgamesh");
        var gilgamesh = new Gilgamesh(gl, textureManager, ()=> {
            gilgamesh.RenderPick("Stand", textureManager, gl);
            console.log("Dhfioa");
        },shaders);
    });
}