The invention discloses an on-line fabric defect detection device for warp knitting machines, which comprises a support assembly, a camera assembly, light sources, and a host control system. The on-line fabric defect detection device for warp knitting machines is characterized in that the light sources are a first light source and a second light source, the first light source is located over a fabric on a warp knitting machine, the supporting assembly comprises a guide way and a drive device, the drive device can drive the second light source and the camera assembly to synchronously slide to and fro along the guide way, the second light source and the camera assembly are located under the fabric on the warp knitting machine, and while sliding to and fro along the guide way, the camera assembly can acquire the image of the fabric; because the adopted moving shooting technique can shorten object distance, imaging quality can be ensured, and a good detection effect can be achieved. Sincethe moving shooting technique is adopted, the number of cameras is reduced, the on-line fabric defect detection device for warp knitting machines is convenient and flexible to mount, the structure ofthe device is simplified, the failure rate is low, multi-angle shooting can be carried out, the detection rate is greatly increased in comparison with the detection rate of the prior art, the false detection rate is greatly decreased, the labor intensity of workers is decreased, and the quality of products is greatly increased.