Mac book Air Does not start without charger connected
Click on Apple icon in top left and go to: About This Mac -> System Report -> Power and see the battery condition. If battery is Normal, check if your computer is actually sleeping after you close the lid.

Reset your SMC and PRAM.
https://support.apple.com/en-us/HT201295
https://support.apple.com/en-us/HT204063

To make sure it is not a software problem, I would boot from an external USB with a clean OS installed on it. And test it with that.

If all these steps fail, I would brought it to Apple store so they would run some hardware diagnostics (it's free, just make an appointment at Genius Bar).

Hopefully SMC would fix it. If not, it sounds like a battery issue. That 'compatible' charger, was it Apple's? Some cheap replicas from eBay are not good. I hope it is not a logic board's power distribution failure which is still fixable, but it's more of a chipset problem then. A chip would have to be replaced/reprogrammed. At Apple, they change the whole board, not just a chip, so wait on fixing it with them (unless you still have Apple Care) and check local and online logic board repair stores.

Hope it helps!