Skip to content

feat(nextjs): point invalid-key errors at the Clerk CLI - #9483

Closed
djgould wants to merge 1 commit into
dg/prod-missing-keys-deploy-errorfrom
dg/invalid-key-cli-error
Closed

feat(nextjs): point invalid-key errors at the Clerk CLI#9483
djgould wants to merge 1 commit into
dg/prod-missing-keys-deploy-errorfrom
dg/invalid-key-cli-error

Conversation

@djgould

@djgould djgould commented Aug 18, 2026

Copy link
Copy Markdown

Description

Stacked on #9481. Extends CLI-first error messaging to invalid (fabricated or mistyped) keys, which previously surfaced as a bare Publishable key not valid. with no guidance:

  • @clerk/shared: the default invalid publishableKey message now recommends npx clerk@latest init and warns against placeholder keys.
  • @clerk/nextjs: clerkMiddleware() validates the publishable key format upfront. Development throws code=invalid_env_keys pointing at npx clerk@latest init; production throws code=invalid_env_keys_production pointing at npx clerk@latest env pull --instance prod.

Sandbox agent trials showed fabricated placeholder keys are the most common agent failure mode, so both messages state the CLI is non-interactive and that invented keys will fail.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🌟 New feature

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 73ea40f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@clerk/shared Patch
@clerk/nextjs Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/electron Patch
@clerk/expo-passkeys Patch
@clerk/expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/headless Patch
@clerk/hono Patch
@clerk/localizations Patch
@clerk/msw Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/react Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/ui Patch
@clerk/vue Patch
@clerk/swingset Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Aug 18, 2026 5:47pm
swingset Ready Ready Preview Aug 18, 2026 5:47pm

Request Review

@djgould

djgould commented Aug 18, 2026

Copy link
Copy Markdown
Author

Superseded by #9486 — restacked fresh off main as part 3 of the keyless→CLI stack (#9484#9485#9486).

@djgould djgould closed this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant