# Function: ensureComponentsLoaded()

> **ensureComponentsLoaded**(): `Promise`<`void`>

Defined in: [components-loader.ts:43](https://github.com/alleyinteractive/allegro/blob/c617a527467b6d9af0d4c7188d082380b2e699b1/packages/allegro-platform/resources/js/sdk/components-loader.ts#L43)

Inject the components bundle, resolving once it has executed and defined the custom elements. Injected only once per page however many times this is called, and rejects when the tenant has no compiled bundle.

Injected as `type="module"`, because the bundle is an ES module whose top-level declarations would otherwise leak into the host page's global lexical scope and collide with its identifiers.

## Returns[​](#returns "Direct link to Returns")

`Promise`<`void`>
