I didn't have this with my kids. They never really carried it that far, but I think I agree with your other poster.
I think maybe she wants to let it go, but is feeling a little reluctant about it because y'all have had so much fun with it, and because that imaginary friend was so "safe" and familiar.
Try telling her it's OK to tell her imaginary friend that it is time to go find other friends to play with. She can tell him/her that it is what happens when kids grow up and go to school. Tell her that if she wants to, it is OK to check in with her old friend now and then if she misses him, but you are very sure he will be just fine, and so will she.
After that I would daily ask her questions about her new friends at school. What are their names ? Who are her best friends and why ? What does she like to play with them ? Would she like some of them to come play at your house now and then ?
Show as much interest and excitement about her school friends as you did about her imaginary friend.
Letting go of an imaginary friend, for some kids, can be as difficult as letting go of a security blanket for others. Others are still sucking their thumbs in kindergarten and struggling to leave that behind. School is a BIG change in their lives in so many ways, and they want to go with it, yet they are very afraid to leave that safe "baby" status behind.
Best wishes.
Keep us posted.
P.S.
And before you start beating yourself up as a parent ...... I came from a VERY secure, loving home, with awesome parents, yet I struggled with giving up an imaginary friend, a security blanket AND sucking my thumb when I went to kindergarten. (They didn't have preschool in those days. Even kindergarten was a new concept.) Some people think kids who have these "vices" are insecure kids. The opposite is true. ALL kids need comforting, but kids who do these things have learned early to comfort themselves, and are not as dependent on parents or others to always meet that need for them.