How old is the toddler? have you tried putting special little teddies on the bed, or even leaving a night light on in the bedroom so its not so dark and also leaving the door open a fraction, so he/she doesn't feel lonely.
Good luck! it will get better.