The moment generating function of a uniform random variable over $[a, b]$ for $a, b \in \mathbb{R}$ and $a < b$ is:
$$ M(t) = \frac{e^{bt} - e^{at}}{t(b - a)} $$
Note that $M^{(1)}(t)$ will have a $t^2$ in the denominator, given the shape of the division rule for derivatives.
This means that $M^{(1)}(0)$ is not defined. So, how can one use it to calculate the expectation of the uniform distribution over $[a, b]$?
The discontinuity at zero is removable. Take the derivative of $M$ and a limit as $t \rightarrow 0$ in the resulting expression.