Will the slide lock back manually with a mag inserted? I mean can you insert the mag, pull the slide back and have it lock? If it will, you recoil spring is too heavy and the slide isn't coming back far enough to allow the mag follower to kick up the slide release.
If it won't (the test), is usually means the mag follower is either missing the lug on the slide stop, or the spring can't exert enough pressure to kick the follower and lug up fast enough to catch the lockback notch as the slide passes.
We could use some more info...like make of gun, ammo used, recoil spring weight. etc.