Firstly, you should check the USB charging line to be sure that it is in good condition. It should not be broken. If the line is broken, please replace it with a new one. If the above step does not work, check whether the phone is charging normally.
Even if the screen is turned off, this is a way for Android to communicate with you. A flashing blue light may indicate that you have a pending Facebook notification, and a flashing red light may indicate that your battery is low.