The term "light" can refer to electromagnetic radiation across a broad range of wavelengths, not just the visible light that we perceive with our eyes. In the context of the early universe, "light" typically refers to electromagnetic radiation in general, including various forms such as radio waves, microwaves, infrared, visible light, ultraviolet, X-rays, and gamma rays.
According to current scientific understanding, the universe began with the Big Bang approximately 13.8 billion years ago. In the early stages of the universe's evolution, it was extremely hot and dense. Photons, which are particles of light, were present in this early universe even before stars like the Sun formed.
Shortly after the Big Bang, the universe entered a phase called the "era of recombination." During this time, the universe cooled down enough for electrons and protons to combine and form neutral hydrogen atoms. This process made the universe become transparent to light.
Prior to the era of recombination, the universe was filled with a dense plasma of charged particles that strongly scattered and absorbed light. Photons would travel only short distances before being scattered, and the universe was opaque to most forms of electromagnetic radiation. Therefore, it is not accurate to say that there was visible light as we know it before the formation of stars.
However, after the era of recombination, about 380,000 years after the Big Bang, the universe became transparent to light. Photons could travel freely without significant scattering. These photons have been propagating through the universe ever since and make up the cosmic microwave background radiation (CMB), which is a remnant of the early stages of the universe. The CMB is a form of light that is detectable today and provides valuable insights into the early universe.
So, while there was no visible light before the formation of stars like the Sun, there were other forms of electromagnetic radiation present in the early universe, and light, in a broader sense, has been an integral part of the universe since its early stages.