מדרש אויף בראשית 2:4

אֵ֣לֶּה תוֹלְד֧וֹת הַשָּׁמַ֛יִם וְהָאָ֖רֶץ בְּהִבָּֽרְאָ֑ם בְּי֗וֹם עֲשׂ֛וֹת יְהוָ֥ה אֱלֹהִ֖ים אֶ֥רֶץ וְשָׁמָֽיִם׃

דאָס איז די געשיכטע פֿון דעם הימל און דער ערד װען זײ זײַנען באַשאַפֿן געװאָרן, אין דעם טאָג װאָס גאָט דער האַר האָט געמאַכט ערד און הימל.

Genesis

The earth was unformed and desolate, and (there was) darkness over the surface of the abyss. The breath of Elohim hovered above the surface of the water.
פֿרעגט אַ רבֿBookmarkShareCopy

Shemot Rabbah

Another interpretation [of the phrase] “these [ve’eleh] are the names” – Rabbi Abbahu says: Anywhere that eleh is stated, it negates what preceded it; ve’eleh, it adds praise to what preceded it. “This is [eleh] the legacy of the heavens and the earth” (Genesis 2:4) negates “void and darkness” (Genesis 1:2). “These are [ve’eleh] the names” adds praise to the seventy people cited above; that they were all righteous.
פֿרעגט אַ רבֿBookmarkShareCopy

Mekhilta DeRabbi Yishmael

Similarly, (Genesis 1:1) "In the beginning G–d created the heavens and the earth": I might think that what takes precedence in the verse took precedence in creation. It is, therefore, written (Genesis 2:4) "on the day that the L–rd G–d made earth and heaven" — They were both created together.
פֿרעגט אַ רבֿBookmarkShareCopy