Can opiates cause insomnia during pregnancy?

Yes. It can cause insomnia whether you are pregnant or not but my question for you is, why in the world are you on opiates while pregnant?