Terrain Material Black when Lit

My terrain material works fine when the viewer is unlit but when the lighting is rendered the whole terrain goes black. The two black sections in the unlit are from masking and those I can fix but I can’t figure out the rest of the terrain.