Yes, a vector can have zero components along a line and still have a nonzero magnitude. Example: Consider a two dimensional vector 2i^+0j^​. This vector has zero components along a line lying along the Y-axis and a nonzero component along the X-axis. The magnitude of the vector is also nonzero.Now, magnitude of 2i^+0j^​ =  22+02​=2