diff --git a/.changeset/tame-glasses-smoke.md b/.changeset/tame-glasses-smoke.md new file mode 100644 index 00000000000..d44078bccef --- /dev/null +++ b/.changeset/tame-glasses-smoke.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Fixes an issue that caused Clerk's UI code to load even before components were rendered. diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index eb91cc89b54..de52b1e20a3 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -2093,16 +2093,16 @@ export class Clerk implements ClerkInterface { }; #handleKeylessPrompt = () => { - void this.#componentControls?.ensureMounted().then(controls => { - if (this.#options.__internal_claimKeylessApplicationUrl) { + if (this.#options.__internal_claimKeylessApplicationUrl) { + void this.#componentControls?.ensureMounted().then(controls => { controls.updateProps({ options: { __internal_claimKeylessApplicationUrl: this.#options.__internal_claimKeylessApplicationUrl, __internal_copyInstanceKeysUrl: this.#options.__internal_copyInstanceKeysUrl, }, }); - } - }); + }); + } }; #buildUrl = (