Genesis, the first book of the Bible, has an error in the depiction of night being separated from day. According to Genesis, God created light and separated day from night on the first day. However, the sun and stars which produce light weren't created until the fourth day. Since the sun is what separates day from night, that separation couldn't have happened until the fourth day. So what happened on the first day?
First Day of Creation
Genesis 1:3-5: And God said, Let there be light: and there was light. And God saw the light, that it was good: and God divided the light from the darkness. And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.
Fourth Day of Creation
Genesis 1:14-19: And God said, Let there be lights in the firmament of the heaven to divide the day from the night; and let them be for signs, and for seasons, and for days, and years: And let them be for lights in the firmament of the heaven to give light upon the earth: and it was so. ...And the evening and the morning were the fourth day
The scientific error here is twofold. First the Bible depicts light as being created in the absence of any objects that would actually product light. Second, the Bible depicts day being separated from night without the existence of the sun, the one object which does separate day from night.
The authors of the Bible didn't understand where light comes from and they didn't understand the role of the sun in our solar system. If people accepted that the Bible is a flawed text created by fallible human beings, that wouldn't be a problem.
Is this a legitimate, scientific error in the Bible or can the Genesis depiction of how day was separated from night be harmonized with the facts of science? If you think you can answer this Bible error, explain how — but your answer cannot add anything new that's not already in the stories and cannot leave out any details that the Bible provides.