From 1b3e7f5ba2e6b199de2dd743f035a372edd9d7f0 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Wed, 8 Apr 2026 17:26:50 -0700 Subject: [PATCH] Fix Vercel integration when publishable client keys are missing --- .../projects/[projectId]/vercel/page-client.tsx | 10 ++++++++-- claude/CLAUDE-KNOWLEDGE.md | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/vercel/page-client.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/vercel/page-client.tsx index d95c36b68..e9116fdf4 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/vercel/page-client.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/vercel/page-client.tsx @@ -84,9 +84,13 @@ export default function PageClient() { description: "Vercel Integration", }); + const publishableClientKey = requirePublishableClientKey + ? (newKey.publishableClientKey ?? throwErr("Expected publishableClientKey when project.requirePublishableClientKey is true")) + : undefined; + setKeys({ projectId: adminApp.projectId, - publishableClientKey: newKey.publishableClientKey ?? throwErr("Expected publishableClientKey after creating an API key with hasPublishableClientKey: true"), + publishableClientKey, secretServerKey: newKey.secretServerKey ?? throwErr("Expected secretServerKey after creating an API key with hasSecretServerKey: true"), }); } finally { @@ -160,7 +164,9 @@ export default function PageClient() { ) : (

- You'll receive a publishable client key and a secret server key for this project. + {requirePublishableClientKey + ? "You'll receive a publishable client key and a secret server key for this project." + : "You'll receive a secret server key for this project."}

), }, diff --git a/claude/CLAUDE-KNOWLEDGE.md b/claude/CLAUDE-KNOWLEDGE.md index 4d40a0c65..fb1e773e5 100644 --- a/claude/CLAUDE-KNOWLEDGE.md +++ b/claude/CLAUDE-KNOWLEDGE.md @@ -164,3 +164,6 @@ A: Add project-level shortcuts to `PROJECT_SHORTCUTS` in `apps/dashboard/src/com Q: Which port suffixes are assigned to the two local docs sites? A: `docs` (old docs app) uses suffix `26`, and `docs-mintlify` uses suffix `04`. Keep these in sync across `docs/package.json`, `docs-mintlify/package.json`, `apps/dev-launchpad/public/index.html`, and `apps/dashboard/.env.development` (`NEXT_PUBLIC_STACK_DOCS_BASE_URL` points to old docs on `26`). + +Q: Why did the dashboard Vercel integration throw "Expected publishableClientKey" during key generation? +A: In `apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/vercel/page-client.tsx`, the code always asserted `newKey.publishableClientKey` even when `project.requirePublishableClientKey` was false. Fix by only asserting/passing `publishableClientKey` when that project config flag is true.