Skip to content

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

Merged
djgould merged 1 commit into
dg/keyless-cli/1-remove-bootstrapfrom
dg/keyless-cli/3-invalid-keys
Aug 18, 2026
Merged

feat(nextjs): point invalid-key errors at the Clerk CLI#9486
djgould merged 1 commit into
dg/keyless-cli/1-remove-bootstrapfrom
dg/keyless-cli/3-invalid-keys

Conversation

@djgould

@djgould djgould commented Aug 18, 2026

Copy link
Copy Markdown

Description

Part 3 of the keyless→CLI stack, stacked on #9485. 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.

Supersedes #9483 (same content, restacked fresh off main).

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

@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 6:20pm
swingset Ready Ready Preview Aug 18, 2026 6:20pm

Request Review

@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0195511

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

This PR includes changesets to release 1 package
Name Type
@clerk/nextjs 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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@djgould
djgould force-pushed the dg/keyless-cli/3-invalid-keys branch from ab58e69 to 0195511 Compare August 18, 2026 18:17
Base automatically changed from dg/keyless-cli/2-prod-error to dg/keyless-cli/1-remove-bootstrap August 18, 2026 18:18
@djgould
djgould merged commit 0195511 into main Aug 18, 2026
4 of 5 checks passed
@djgould
djgould deleted the dg/keyless-cli/3-invalid-keys branch August 18, 2026 18:18
@djgould
djgould restored the dg/keyless-cli/3-invalid-keys branch August 18, 2026 18:20
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