I can't say for sure with so little information provided. But I bet you have a Dell. If so I would be willing to bet that it is a motherboard problem. If that is the case than you just have to start leaving it plugged in. But maybe I am wrong. Maybe you can get lucky. Have you tried just taking it out and putting it back in?
Chat with our AI personalities
Check if the battery is physically there and if it is there is it properly seated. The other possibility is that the battery is so drained that the system is unable to detect its presence. If it is the later you may need to replace the battery.
Because it's failing to detect the battery. Why that's happening is a separate question. You'll probably need to take it to a repair shop.