From 8eaab1c319bef2055c502ab093b64c8b6c568c20 Mon Sep 17 00:00:00 2001 From: Devin Gould Date: Fri, 28 Aug 2026 10:39:56 -0400 Subject: [PATCH] fix(shared): Avoid trailing period after dashboard URL in key error messages Terminals and dev overlays linkify the sentence period into the URL, producing a broken /last-active?path=api-keys. link. Co-Authored-By: Claude Fable 5 --- .changeset/fix-dashboard-link-punctuation.md | 5 +++++ packages/shared/src/errors/errorThrower.ts | 6 +++--- packages/shared/src/keys.ts | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/fix-dashboard-link-punctuation.md diff --git a/.changeset/fix-dashboard-link-punctuation.md b/.changeset/fix-dashboard-link-punctuation.md new file mode 100644 index 00000000000..382b2286084 --- /dev/null +++ b/.changeset/fix-dashboard-link-punctuation.md @@ -0,0 +1,5 @@ +--- +'@clerk/shared': patch +--- + +Reword the missing/invalid key error messages so the Clerk Dashboard URL is no longer immediately followed by a period. Terminals and dev overlays were including the period in the link, producing a broken URL that failed to open the API Keys page. diff --git a/packages/shared/src/errors/errorThrower.ts b/packages/shared/src/errors/errorThrower.ts index 491a8e8c04e..37f6a694a5c 100644 --- a/packages/shared/src/errors/errorThrower.ts +++ b/packages/shared/src/errors/errorThrower.ts @@ -6,21 +6,21 @@ npx clerk@latest init \`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive. -If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/last-active?path=api-keys.`, +If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/last-active?path=api-keys in the Clerk Dashboard.`, MissingPublishableKeyErrorMessage: `Missing publishableKey. To set up Clerk for this project, in your terminal run: npx clerk@latest init \`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive. -If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/last-active?path=api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`, +If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/last-active?path=api-keys in the Clerk Dashboard. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`, MissingSecretKeyErrorMessage: `Missing secretKey. To set up Clerk for this project, in your terminal run: npx clerk@latest init \`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive. -If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/last-active?path=api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`, +If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/last-active?path=api-keys in the Clerk Dashboard. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`, MissingClerkProvider: `{{source}} can only be used within the component. Learn more: https://clerk.com/docs/components/clerk-provider`, }); diff --git a/packages/shared/src/keys.ts b/packages/shared/src/keys.ts index c293a74bcb9..8e6349c037b 100644 --- a/packages/shared/src/keys.ts +++ b/packages/shared/src/keys.ts @@ -104,7 +104,7 @@ npx clerk@latest init \`npx clerk@latest init\` creates a Clerk application and writes keys to your .env file. No Clerk account or login required and the command is non-interactive. -If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy them from https://dashboard.clerk.com/last-active?path=api-keys.`; +If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy them from https://dashboard.clerk.com/last-active?path=api-keys in the Clerk Dashboard.`; export function parsePublishableKey( key: string | undefined,