Position.project() method not working without Orbit controls

So, I was trying to create a template for myself consisting of various uniforms that I can use to write fragment shaders from shadertoy.com , like copying all the necessory uniforms
So to get the width of plane geometry(on which the shader will be applied) I used position.project() method and it worked but when I removed Orbit controls from the code, outputs from the project() method gave result in infinity
I don’t know why it is doing this
This is the code I used


geometry.computeBoundingBox();
const bottomLeft = geometry.boundingBox.min;
const topRight = geometry.boundingBox.max;

bottomLeft.project(camera);
topRight.project(camera);

let Width = ((topRight.x - bottomLeft.x) / 2) * sizes.width;
let Height = ((topRight.y - bottomLeft.y) / 2) * sizes.height;
material.uniforms.width = new THREE.Uniform(Width);
material.uniforms.height = new THREE.Uniform(Height);