Package: @clerk/astro (observed on 2.17.13)
File: src/internal/create-clerk-instance.ts (createClerkInstanceInternal)
In createClerkInstanceInternal, the Clerk load call is wired as:
clerkJSInstance.load(initOptions).then(() => {
$csrState.setKey("isLoaded", true);
mountAllClerkAstroJSComponents();
// ...addListener, etc.
}).catch(() => {});
The empty .catch() discards every error and every rejection from load(). Because mounting and the isLoaded state both live in the .then(), any failure or stall of that single load() call leaves the page in a fully silent broken state: the script is present, window.Clerk exists, window.Clerk.loaded stays false, no component mounts, and nothing is logged to the console.
Impact: consumers cannot diagnose sign-in/sign-up mount failures at all. We hit a Safari-only case where the initial load() did not complete in time for its .then() to run; the mount is wired to that one .then() with no retry, and the empty .catch() meant there was no console error, no telemetry, nothing. It cost most of a day to trace, entirely because the failure was swallowed.
Reproduction (Safari):
- On initial load:
typeof window.Clerk → "object", window.Clerk.loaded → false, and no environment/client network call is made after clerk.browser.js downloads.
- Console is clean. No error, because the
.catch() swallows it.
- Manual
await window.Clerk.load() later resolves fine, and a manual window.Clerk.mountSignIn(node) renders correctly. So the capability is present; only the integration's single, silent, no-retry call failed.
Requests:
- Do not swallow. At minimum
console.error the caught error; ideally route it through Clerk's telemetry or an onError hook consumers can subscribe to.
- Consider decoupling the mount from a single
load() resolution, or adding a bounded retry, so a slow/stalled first load() can still recover.
Environment: @clerk/astro 2.17.13, @clerk/clerk-js hotloaded at @5 (currently 5.127.1), Astro 5, Safari.
Package:
@clerk/astro(observed on 2.17.13)File:
src/internal/create-clerk-instance.ts(createClerkInstanceInternal)In
createClerkInstanceInternal, the Clerk load call is wired as:The empty
.catch()discards every error and every rejection fromload(). Because mounting and theisLoadedstate both live in the.then(), any failure or stall of that singleload()call leaves the page in a fully silent broken state: the script is present,window.Clerkexists,window.Clerk.loadedstaysfalse, no component mounts, and nothing is logged to the console.Impact: consumers cannot diagnose sign-in/sign-up mount failures at all. We hit a Safari-only case where the initial
load()did not complete in time for its.then()to run; the mount is wired to that one.then()with no retry, and the empty.catch()meant there was no console error, no telemetry, nothing. It cost most of a day to trace, entirely because the failure was swallowed.Reproduction (Safari):
typeof window.Clerk→"object",window.Clerk.loaded→false, and no environment/client network call is made afterclerk.browser.jsdownloads..catch()swallows it.await window.Clerk.load()later resolves fine, and a manualwindow.Clerk.mountSignIn(node)renders correctly. So the capability is present; only the integration's single, silent, no-retry call failed.Requests:
console.errorthe caught error; ideally route it through Clerk's telemetry or anonErrorhook consumers can subscribe to.load()resolution, or adding a bounded retry, so a slow/stalled firstload()can still recover.Environment:
@clerk/astro2.17.13,@clerk/clerk-jshotloaded at@5(currently 5.127.1), Astro 5, Safari.