Skip to content

feat(shared): Export ClerkAPIResponseError from error subpaths#8228

Merged
jacekradko merged 3 commits intomainfrom
jacek/export-clerk-api-response-error
Apr 2, 2026
Merged

feat(shared): Export ClerkAPIResponseError from error subpaths#8228
jacekradko merged 3 commits intomainfrom
jacek/export-clerk-api-response-error

Conversation

@jacekradko
Copy link
Copy Markdown
Member

@jacekradko jacekradko commented Apr 2, 2026

Summary

  • Re-export ClerkAPIResponseError and isClerkAPIResponseError from @clerk/backend/errors
  • Add ClerkAPIResponseError and ClerkRuntimeError class exports to @clerk/react/errors, @clerk/nextjs/errors, @clerk/react-router/errors, @clerk/vue/errors, and @clerk/nuxt/errors alongside the already-exported type guards
  • Add missing isClerkRuntimeError to @clerk/react-router/errors

These error classes are thrown in user-facing code paths but weren't importable from the SDK packages that surface them, requiring users to separately install @clerk/shared.

Test plan

  • pnpm build passes
  • Backend export snapshot test updated and passing
  • React-router export snapshot unaffected (doesn't cover /errors subpath)

Summary by CodeRabbit

  • New Features

    • ClerkAPIResponseError and ClerkRuntimeError are now exported from the error subpaths of backend, React, Next.js, React Router, Vue, and Nuxt packages, unifying error exports across frameworks.
  • Chores

    • Added a changeset entry marking a patch release that includes these export updates.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
clerk-js-sandbox Skipped Skipped Apr 2, 2026 6:36pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

🦋 Changeset detected

Latest commit: bfa2bb0

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

This PR includes changesets to release 15 packages
Name Type
@clerk/backend Patch
@clerk/react Patch
@clerk/nextjs Patch
@clerk/react-router Patch
@clerk/vue Patch
@clerk/nuxt Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/chrome-extension Patch
@clerk/expo 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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 2, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@8228

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8228

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: bfa2bb0

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6e8b7167-5155-4de4-94e3-2881cf10b705

📥 Commits

Reviewing files that changed from the base of the PR and between 7368117 and bfa2bb0.

📒 Files selected for processing (1)
  • packages/nextjs/src/errors.ts

📝 Walkthrough

Walkthrough

A changeset entry was added for six packages. The public error subpaths were expanded to also export ClerkAPIResponseError and ClerkRuntimeError across clerk/backend, clerk/react, clerk/nextjs, clerk/react-router, clerk/vue, and clerk/nuxt by adding re-exports in their errors modules. An export-test snapshot was updated to include the newly exported symbols.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main purpose of the changeset: exporting ClerkAPIResponseError and ClerkRuntimeError from error subpaths across multiple Clerk packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@jacekradko jacekradko merged commit abfd5ef into main Apr 2, 2026
44 checks passed
@jacekradko jacekradko deleted the jacek/export-clerk-api-response-error branch April 2, 2026 18:40
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.

2 participants