So you don't consider the Earth being formed before there was "light" to be a conflict?
When one is erroneous in his or her beliefs, then it is very difficult for him or her to get it right. You are correct, according to the Genesis story the earth was created on the 3rd day and then the light was created on the 4th day.
Genesis 1:9-13 nasb
9Then God said, " Let the waters below the heavens be gathered into one place, and let the dry land appear"; and it was so.
10God called the dry land earth, and the gathering of the waters He called seas; and God saw that it was good.
11Then God said, "Let the earth sprout vegetation, plants yielding seed, and fruit trees on the earth bearing fruit after their kind with seed in them"; and it was so.
12The earth brought forth vegetation, plants yielding seed after their kind, and trees bearing fruit with seed in them, after their kind; and God saw that it was good.
13There was evening and there was morning, a third day.
Genesis 1:14-19
14Then God said, "Let there be lights in the expanse of the heavens to separate the day from the night, and let them be for signs and for seasons and for days and years;
15and let them be for lights in the expanse of the heavens to give light on the earth"; and it was so.
16God made the two great lights, the greater light to govern the day, and the lesser light to govern the night; He made the stars also.
17God placed them in the expanse of the heavens to give light on the earth,
18and to govern the day and the night, and to separate the light from the darkness; and God saw that it was good.
19There was evening and there was morning, a fourth day.