Replies: 1 comment 1 reply
-
Hello, Simply wrap the Alpine.start() in a DOMContentLoaded: import Alpine from "alpinejs";
window.Alpine = Alpine;
document.addEventListener("DOMContentLoaded", () => {
Alpine.start();
}); otherwise the JS is executed before the DOM is... loaded. :P |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://alpinejs.dev/essentials/installation#as-a-module
Alpine Warning: Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?
Normally adding alpine this way doesnt throw errors but I am not exactly sure how everything is working behind the scenes in tailpress. Any suggestions? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions