The causes of heart pain in sleeping are nerve excitement, anxiety, heart disease, chest disease, and gastroesophageal reflux disease. 1. Nervous excitement: if the recent mental stress is relatively large, excessive increase in physical strength during the day, strenuous exercise before going to bed, staying up all night, etc. will lead to the occurrence of heart discomfort. You should relax your body and mind and avoid staying up late at night. 2. Anxiety disorders: Anxiety disorders can trigger autonomic dysfunction, leading to cardiac discomfort, palpitations and pain. 3. Heart disease: If there is congenital heart disease, heart failure, myocardial ischemia, myocardial infarction and other heart diseases, this situation may also occur. 4. Chest diseases: some lung lesions, thoracic lesions, intercostal neuritis, etc. may also present with pain in the heart region. 5. Gastroesophageal reflux disease (GERD): it is the reflux of gastric contents into the esophagus, dietary esophageal injury, and chest and precordial pain. If this situation occurs for a long time, you should go to the hospital in time to get a clear diagnosis and symptomatic treatment.