This can happen for two reasons. First, check to make sure that your dispenser is draining properly and it isn’t clogged. Clean out the dispenser and softener compartment. Pour a cup of water into the softener compartment quickly until it starts to overflow. It should then siphon the water out and if so that means the unit is definitely clean. If you run a cycle and you still have problems, you will need to replace your cold water valve. This valve has two solenoids on it and one of them is for the detergent, the other is for softener and bleach. Replace the valve and you should be good to go again.
Disclosure: Bear in mind that some of the links in this post are affiliate links and if you go through them to make a purchase I will earn a commission. Keep in mind that I link these companies and their products because of their quality and not because of the commission I receive from your purchases.