Type 2 here and have been for the last 6 years. Decided to get fit when i found out, so got the bike out.
6 years on and I’m still riding and now running. Did suffer with cramps on short rides but the cramps have lessened as the muscles have become stronger.
So IMHO I think cramps are probably down to two things hydration and fatigue. But as others have posted on here and elsewhere if it was down to low electrolytes the whole of your body would cramp up, I’m no expert but sounds feasible.
I’ve tried all sorts of high fives and nuunn drinks and I just find that if you keep hydrated with water,corporation pop until it was privatised, you should be fine as I did find myself cramping up quite badly with the additives.
They don’t work for me but might for others, trail and error.