Public paste target for clerk/javascript BUG_REPORT.yml Reproduction field.
Owner must be personal account luchillo17 — not Vital-Link-360 / carlos-vitallink360.
While signed in and idle:
useAuth()often returns a new object reference.userId/sessionId/orgIdstay equal.- The demo counter object churn while ids stable increments (bug signal).
- A Convex-style
useCallback(..., [auth])bridge identity also churns in lockstep. getTokenfunction identity churn (while ids stable) is counted separately.- If this Clerk build exposes
isRefreshingon the auth object, flips are counted; otherwise the UI showsn/a.
Expected: after a short settle (~1.5s), object churn while ids stable stays 0.
Actual: that counter climbs on idle / token-refresh ticks without identity changes.
- Next.js App Router 15.4.7 +
@clerk/nextjs^7.9.x (Clerk Core 3) - Client gate:
app/auth-gate.tsx(useAuth) — not serverShow/SignedIn - Meter counters live in refs and flush on an interval (avoids max-update-depth when
useAuth()returns a new object every render) - No Convex deploy — page mocks the bridge with
useCallback([auth])
https://stackblitz.com/github/luchillo17/clerk-useauth-identity-repro
Do not rely on StackBlitz / WebContainers for this repro. @clerk/nextjs App Router sign-in calls a server action that does cookies().delete(...). WebContainers have no Next request scope for that → POST / 500 (cookies().delete was called outside a request scope). Run locally (below). Paste the GitHub URL into Clerk’s bug form.
cp .env.example .env.local
# paste pk_test_ / sk_test_ from https://dashboard.clerk.com → API Keys
npm install
npm run devOpen http://localhost:3000 → sign in → leave the tab idle 30–60s → watch the counters.
Clerk Dashboard → Configure → Domains (or allowed origins): add http://localhost:3000.
Do not create/push with Vital Link work tokens (carlos-vitallink360). Use personal login:
gh auth login # choose luchillo17
gh api user --jq .login # must print: luchillo17
cd /path/to/clerk-useauth-identity-repro
gh repo create luchillo17/clerk-useauth-identity-repro --public --source=. --remote=origin --pushIf the name is taken:
gh repo create luchillo17/clerk-useauth-identity-churn-repro --public --source=. --remote=origin --pushReproduction field paste:
https://github.com/luchillo17/clerk-useauth-identity-repro
StackBlitz URL (unsupported — see above):
https://stackblitz.com/github/luchillo17/clerk-useauth-identity-repro
| Var | Required | Notes |
|---|---|---|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY |
yes | pk_test_… |
CLERK_SECRET_KEY |
yes (middleware) | sk_test_… — local only; never commit |
No other secrets. No Vital Link product code.
app/auth-churn-meter.tsx— identity / optionalisRefreshing/getToken/ bridge countersapp/page.tsx— signed-in demo shellmiddleware.ts— stockclerkMiddleware()
MIT — free to paste into upstream Clerk issue trackers.