To form the primary heart tube in zebrafish, bilateral cardiac precursor cells (CPCs) migrate toward the midline beneath the endoderm. Mutants lacking endoderm and fish with defective sphingosine 1-phosphate (S1P) signaling exhibit cardia bifida. Endoderm defects lead to the lack of foothold for the CPCs, whereas the cause of cardia bifida in S1P signaling mutants remains unclear. Here we show that S1P signaling regulates CPC migration through Yes-associated protein 1 (Yap1)-dependent endoderm survival. Cardia bifida seen in spns2 (S1P transporter) morphants and s1pr2 (S1P receptor-2) morphants could be rescued by endodermal expression of nuclear localized form of yap1. yap1 morphants had decreased expression of the Yap1/Tead target connective tissue growth factor a (Ctgfa) and consequently increased endodermal cell apoptosis. Consistently, ctgfa morphants showed defects of the endodermal sheet and cardia bifida. Collectively, we show that S1pr2/Yap1-regulated ctgfa expression is essential for the proper endoderm formation required for CPC migration.