I'm not sure what the error was, if anyone knows why this occurs I will gladly accept that as an answer.
This error seesm to stem from the way Astro bundles javascript. I removed @astrojs/alpinejs and just installed alpinejs and import it in my script tag like so;
<script>
import Alpine from "alpinejs";
window.Alpine = Alpine;
Alpine.data("stats", () => ({
}));
Alpine.start();
</script>
Which works great.