This isn't necessary in some cases, especially in properly posed loops where the last value is exactly the same as the first, but did you make sure you added keys to the start of the animation?
To do this, in the editor, you can select frame 0 and press CTRL
+SHIFT
+L
This will make sure all existing dopesheet items have keys at that point in time.