Boy confusion?

I’ve been hardcore flirting with this guy and it was kind of a one sided joke thing. But he started to have feelings back me and for about a few weeks I liked it and we talked a lot, but when things got more serious and he started to flirt back I don’t feel attracted to him anymore and I feel really bad because this always happens. I get close to someone and then i almost kind of chicken out or don’t feel attracted to them anymore. Do I have commitment issues or I just don’t like to date people or what. Because I have no trouble like hardcore flirting when I doesn’t mean anything. But once it starts to mean something I don’t like it anymore. Any explanations or advice!