The first solar flare was seen in 1851, when two astronomers were studying sunspots. Of course this wasn't the first flare on the Sun, just the first one that astronomers had been able to see.
The two astronomers who saw it were called Carrington and Hodgeson. They were independently studying the Sun using special equipment, which enabled them to make observations in visible light safely. They certainly can't have been making X-ray observations. William Röntgen, the German scientist who would later discover X-rays, was only 6 years old at the time!
What was it that Carrington and Hodgeson had seen? We now know they had observed a very large solar flare because only the very largest can be seen in visible light. Solar flares are most easily detected in X-rays or ultraviolet radiation.
Check out these two images of the Sun One is taken in X-rays and one in visible light. Very different things can be seen in each one. That's why it's very important that we look at as many different wavelengths in the electromagnetic spectrum as possible when we study the Sun - if we don't we might miss some vital clue to what's going on.