Skip to content

feat(nextjs): Added error with docs URL in Core 3 for <SignedIn>, <SignedOut> and <Protect> - #9273

Merged
royanger merged 8 commits into
mainfrom
ra/add-url-to-signedin-signedout-error
Aug 12, 2026
Merged

feat(nextjs): Added error with docs URL in Core 3 for <SignedIn>, <SignedOut> and <Protect>#9273
royanger merged 8 commits into
mainfrom
ra/add-url-to-signedin-signedout-error

Conversation

@royanger

@royanger royanger commented Jul 29, 2026

Copy link
Copy Markdown
Member

Description

AI agents frequently generate <SignedIn>, <SignedOut>, and <Protect> for @clerk/nextjs — components removed in Clerk Core 3 and replaced by <Show>. Out-of-date training data means agents still reach for them (surfaced by 2027.dev evals). This re-adds the three exports as inert shims that throw a descriptive, docs-linked error when rendered, giving a human or agent an actionable migration path (install the Clerk CLI/Skills, swap to <Show>) instead of a confusing "undefined" failure.

The error URLs resolve to docs pages added in clerk/clerk#3062, which needs to ship before this releases.

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:

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 718b887

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

@vercel

vercel Bot commented Jul 29, 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 12, 2026 3:52am
swingset Ready Ready Preview Aug 12, 2026 3:52am

Request Review

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-08-12T03:52:10.410Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 1
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 3

@clerk/nextjs

Current version: 7.7.4
Recommended bump: MINOR → 7.8.0

🟢 Additions (3)

Added: Protect

+ export declare function Protect(_props: RemovedControlComponentProps): never;

Added function Protect

Added: SignedIn

+ export declare function SignedIn(_props: RemovedControlComponentProps): never;

Added function SignedIn

Added: SignedOut

+ export declare function SignedOut(_props: RemovedControlComponentProps): never;

Added function SignedOut


Report generated by Break Check

Last ran on 718b887.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds runtime migration-error placeholders for the removed SignedIn, SignedOut, and Protect components, re-exports them from @clerk/nextjs, and verifies their errors with tests. A patch changeset documents the new behavior. It also raises the Bundlewatch limit for clerk.browser.js from 75KB to 76KB.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: brkalow

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the new error and documentation URL for the three removed components.
Description check ✅ Passed The description explains the component shims, migration guidance, documentation URLs, tests, and build status.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/nextjs/src/__tests__/removedControlComponents.test.ts (1)

3-17: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the public package export.

These tests bypass packages/nextjs/src/index.ts, so a broken @clerk/nextjs re-export could pass. Add a small API-surface test importing SignedIn and SignedOut through the package entrypoint.

As per coding guidelines, new functionality should include comprehensive coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/nextjs/src/__tests__/removedControlComponents.test.ts` around lines
3 - 17, Extend the tests in “removed control components” to import SignedIn and
SignedOut through the public package entrypoint exposed by
packages/nextjs/src/index.ts, and add API-surface assertions that both exports
retain the same docs-linked throwing behavior. Keep the existing direct-module
tests intact while ensuring the package re-exports are exercised.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/nextjs/src/__tests__/removedControlComponents.test.ts`:
- Around line 3-17: Extend the tests in “removed control components” to import
SignedIn and SignedOut through the public package entrypoint exposed by
packages/nextjs/src/index.ts, and add API-surface assertions that both exports
retain the same docs-linked throwing behavior. Keep the existing direct-module
tests intact while ensuring the package re-exports are exercised.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 7157b661-6b9a-4959-b697-027193ce9ee7

📥 Commits

Reviewing files that changed from the base of the PR and between a8f6e89 and 23417ef.

📒 Files selected for processing (4)
  • .changeset/signed-in-signed-out-error.md
  • packages/nextjs/src/__tests__/removedControlComponents.test.ts
  • packages/nextjs/src/index.ts
  • packages/nextjs/src/removedControlComponents.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/cli (auto-detected)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)

@pkg-pr-new

pkg-pr-new Bot commented Jul 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-google-signin

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 718b887

@brkalow brkalow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@royanger royanger changed the title feat: Added error with docs URL in Core 3 for <SignedIn> and <SignedOut> feat(nextjs): Added error with docs URL in Core 3 for <SignedIn>, <SignedOut> and <Protect> Aug 7, 2026
@royanger
royanger requested a review from brkalow August 7, 2026 21:04
@manovotny

Copy link
Copy Markdown
Contributor

Added the do not merge label (although I don't think it blocks CI on this repo) since the docs pages need to launch first (https://github.com/clerk/clerk/pull/3062) so the errors don't link to pages that 404.

@manovotny manovotny self-assigned this Aug 12, 2026
manovotny and others added 2 commits August 11, 2026 22:48
This nextjs-only PR shouldn't touch the clerk-js bundle budget; the stray
bump also conflicted with main. Reverting to base so the merge takes main's
current values.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@manovotny

Copy link
Copy Markdown
Contributor

Pushed some changes directly in b0a6a28.

  • Dropped the unrelated clerk.browser.js bundlewatch bump — a nextjs-only change can't grow the clerk-js bundle, and it was what conflicted with main.
  • Merged main in (718b887) so this sits on the current base.

@manovotny

Copy link
Copy Markdown
Contributor

On CodeRabbit's nit about covering the public package export: skipping it.

The other test file in this package (webhooks.test.ts) imports from ../webhooks, so testing the source module directly is the convention here, and the new test matches it. Break Check already confirms all three exports land in the public API, and a through-index.ts test would need the #components server/client conditional import resolved, which these unit tests don't set up.

@manovotny manovotny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, @royanger! 👏

@royanger
royanger merged commit f9c97ef into main Aug 12, 2026
54 checks passed
@royanger
royanger deleted the ra/add-url-to-signedin-signedout-error branch August 12, 2026 19:08
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.

3 participants