Bad calf cramping during training ride

Something strange happened during my training ride tonight.

I started getting really bad calf muscle cramps in both calves. This has never happened to me before?

I normally do my rides fasted, early in the morning. Unfortunately, I missed my ride this morning so I did it after dinner.

I was riding avalanche spire +1 (I am approaching the halfway point of sustained power build, low volume).

Any thoughts on what could have caused this? And more importantly how to avoid it?

Hydration. Are you taking enough liquid especially with magnesium and potassium.

I strongly recommend to look into below products. Please refer to your doctor/nutritionist before you start using them.