I have calculated the moment generating function for the uniform distribution as
$$M_X(t)=\frac{e^{tb}-e^{ta}}{t(b-a)}$$
However I know $M_X(0)=1$ but I can't get my head around how this is possible as if $t=0$, the denominator $= 0$ and therefore the function is undefined, where am I going wrong?
Technically speaking, $$ M_X(t)=\begin{cases}\displaystyle \frac{e^{tb}-e^{ta}}{t(b-a)} & \text{if $t\neq 0$}\\ 1 & \text{if $t=0$}\end{cases}. $$ If you look through the calculations that you used to come up with the MGF, you'll find that there's one point where you've divided by $t$... meaning that you would've needed to handle the case $t=0$ separately.
We don't tend to sweat this very much, however, because $M_X(t)\rightarrow1$ as $t\rightarrow0$ -- that is, your version of $M_X(t)$ has a removable discontinuity at $t=0$.