Minimal synthetic reproduction against the real published @clerk/shared package. It uses fake DOM objects and timers; it makes no script requests, uses no real Clerk application or credentials, and needs no browser.
With Node 24.22.0 and pnpm 10.33.0:
pnpm install --ignore-scripts
pnpm repro js late-success
pnpm repro ui late-success
pnpm repro js failureThe script intentionally exits 1 when it observes an unhandled rejection. It attaches both success and failure handlers to the promise returned by the loader.
For late-success, another loader is simulated making Clerk available after 100ms. The pending script attempts fail after 200ms each. The returned load operation resolves, but the script retry chain still emits an unhandled failed_to_load_clerk_js (or failed_to_load_clerk_ui). Expected: the returned operation remains resolved, with no unhandled rejection.
For failure, no Clerk global appears. Expected: the returned operation rejects, without an additional unhandled rejection.
The key is synthetically generated for probe.clerk.accounts.dev; it does not identify a real application. The unhandledRejection listener only observes the bug for this reproduction; it is not a proposed application workaround.