Skip to content

feat(nextjs): throw missing-env error instead of keyless bootstrap - #9484

Closed
djgould wants to merge 3 commits into
mainfrom
dg/keyless-cli/1-remove-bootstrap
Closed

feat(nextjs): throw missing-env error instead of keyless bootstrap#9484
djgould wants to merge 3 commits into
mainfrom
dg/keyless-cli/1-remove-bootstrap

Conversation

@djgould

@djgould djgould commented Aug 18, 2026

Copy link
Copy Markdown

Description

Part 1 of the keyless→CLI stack. Experiment: promote the CLI keyless flow over SDK keyless mode.

In development, when NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY / CLERK_SECRET_KEY are missing, @clerk/nextjs no longer provisions a keyless application. All three bootstrap entry points (app-router server ClerkProvider, clerkMiddleware, createOrReadKeylessAction) now throw a code=missing_env_keys error directing to:

npx clerk@latest init

The message states the command is non-interactive and requires no Clerk account or login (sandbox agent trials showed agents otherwise route around the CLI or invent placeholder keys). The error surfaces in both the dev server log and the dev error page. Configured keys, claimed keys, and production behavior are unchanged.

Supersedes #9474 (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

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other: experiment / RFC

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1072f9f

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

This PR includes changesets to release 10 packages
Name Type
@clerk/backend Patch
@clerk/nextjs Minor
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing 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 6:20pm
swingset Ready Ready Preview Aug 18, 2026 6:20pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9484

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9484

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9484

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9484

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9484

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9484

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9484

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9484

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9484

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9484

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9484

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9484

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9484

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9484

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9484

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9484

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9484

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9484

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9484

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9484

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9484

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9484

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9484

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9484

commit: 1072f9f

djgould and others added 3 commits August 18, 2026 11:11
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Squashed from the original four commits of this PR (bootstrap removal, import
sort, adversarial-review findings, non-interactive CLI wording) during the
simple-first stack reorder.

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

djgould commented Aug 18, 2026

Copy link
Copy Markdown
Author

Recreated as #9493 to re-base it inside the reordered stack (GitHub blocks base edits on stack members); content unchanged. Successor of #9474.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant