# Alpine.js not loading when component is the only element on the page

**URL:** <https://forums.realmacsoftware.com/t/alpine-js-not-loading-when-component-is-the-only-element-on-the-page/56725>\
**Category:** Elements API\
**Created:** [June 20, 2026, 12:02pm UTC](https://forums.realmacsoftware.com/t/alpine-js-not-loading-when-component-is-the-only-element-on-the-page/56725 "2026-06-20T12:02:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MultiThemes](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/multithemes/32/25117_2.png) [@MultiThemes](https://forums.realmacsoftware.com/u/MultiThemes)\
**Post date:** [June 20, 2026, 12:02pm UTC](https://forums.realmacsoftware.com/t/alpine-js-not-loading-when-component-is-the-only-element-on-the-page/56725/1 "2026-06-20T12:02:57Z")

</div>

Sorry if this isn’t the right category, I couldn’t find the one I remember for component development discussions.

@tpbradley quick finding while testing components that load Alpine.js via the standard shared bodyEnd template (`shared/assets/` + `shared/templates/bodyEnd/`).

If the component is the only element on the page, the shared bodyEnd script doesn’t get injected and Alpine never loads 😲 . Add any other element to the page (a divider, a text block) and it works fine. 🤔

Not an issue for me in practice, real pages always have other elements. Just wanted to flag it and ask: is this expected behavior, or is there a way to force a shared bodyEnd template to load even with a single component on the page? Couldn’t find anything on this in the docs.

Thanks! 🙏

---

<div class="post-metadata">

**Author:** ![ben](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ben/32/28488_2.png) [@ben](https://forums.realmacsoftware.com/u/ben)\
**Post date:** [June 20, 2026, 1:14pm UTC](https://forums.realmacsoftware.com/t/alpine-js-not-loading-when-component-is-the-only-element-on-the-page/56725/2 "2026-06-20T13:14:39Z")

</div>

right now, at least one of the Core Components that ships with Elements needs to be on the page for Alpine to be loaded.

---

<div class="post-metadata">

**Author:** ![MultiThemes](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/multithemes/32/25117_2.png) [@MultiThemes](https://forums.realmacsoftware.com/u/MultiThemes)\
**Post date:** [June 20, 2026, 3:34pm UTC](https://forums.realmacsoftware.com/t/alpine-js-not-loading-when-component-is-the-only-element-on-the-page/56725/3 "2026-06-20T15:34:52Z")

</div>

@ben thnaks for the fast reply

Good to know, **I wasted a lot of time before** I realized it. Because often, to keep my code clean, I test the components on a completely blank page. I even incorporated the library, only to realize it wasn’t needed.

thanks
