Creating shadows in custom shaders

So I have been working on quite a large project. It is finished, except I need to implement proper lighting. I have the light source, intensity, and color accounted for, but need to create shadows on my own, as using pointShadow causes three.js to throw an error “cannot read property x of undifined”. I checked the error, and it is for “shadowMapSize”. So I desided to use the depth (to calculate the shadows myself). Even though I am adding my meshes to the scene used in the WebGLTarget, the depth texture is still a solid value. The relevant code is below, any suggestions would be great! (Note that the models and textures render perfectly in the normal scene)

(idk how to format the code here, so I made a pastebin