It happens when your bones don't get enough minerals. There are a few main reasons it can happen:
You’re not getting enough vitamin D, which you need to absorb calcium from your diet.
Your body has a hard time absorbing vitamin D. That could happen because of gastric bypass or other surgeries that remove part of your stomach or intestines, celiac disease, and certain liver or kidney disorders.
Some seizure medications can cause it.
It’s rare, but some people have a genetic condition that causes osteomalacia.