-
Notifications
You must be signed in to change notification settings - Fork 435
Description
Description
After upgrading @clerk/nextjs from 6.37.2 to 6.38.0 (via Dependabot), Clerk authentication on Vercel preview deployments using development instance keys (pk_test_*) stopped working. The browser console shows:
Clerk: Clerk has been loaded with development keys.
Failed to load resource: the server responded with a status of 400 ()
This was working on 6.37.2 with the same configuration and environment variables. Downgrading back to 6.37.2 resolves the issue.
Steps to reproduce
- Create a Next.js app with
@clerk/nextjsusing development instance keys (pk_test_*/sk_test_*) - Deploy to Vercel with Preview environment using the development keys
- Works on
@clerk/nextjs@6.37.2 - Upgrade to
@clerk/nextjs@6.38.0 - Visit the Vercel preview URL (e.g.
*.vercel.app) — Clerk returns 400
Expected behavior
Development instance keys should work on Vercel preview deployments (*.vercel.app domains), as documented in Set up a preview environment:
"Configure the preview environment to use development API keys from Clerk" with "your host's provided preview domain"
Actual behavior
Clerk returns a 400 error during authentication. The app cannot load the Clerk client.
Environment
@clerk/nextjs: 6.38.0 (broken), 6.37.2 (works)next: 16.1.6- Deployment: Vercel preview (default
*.vercel.appdomain) - Clerk instance: Development (using
pk_test_*keys)
Suspected cause
The 6.38.0 release notes include a fix for "infinite handshake redirect loop when deploying Next.js apps with Clerk development instances to Netlify." This handshake fix may have tightened domain validation in a way that rejects *.vercel.app preview URLs for development instances.