Why does my car stall when I turn on the ac or heat? on 2004 Chevrolet Trailblazer

I recently replaced the alternator in my 2004 Chevrolet Trailblazer. After it was replaced, I drove my vehicle and turned on the air conditioner. Immediately, the car began to stall out. I gassed it, and it continued to drive. I turned off the ac and it stopped stalling.

Asked by for the 2004 Chevrolet Trailblazer
6 or 8 cylinders? Need to know different repair procedures for diff. engines!
No, either V/8 or inline 6. Get a repair shop to scan test!
in line 6