-
Notifications
You must be signed in to change notification settings - Fork 569
Description
Describe the bug
When using the official Next Forge Vercel deployment template, the build fails with missing CLERK_SECRET_KEY
and NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
environment variables. These variables are not even included as configurable fields in the Vercel deployment form, making it impossible to provide them during the deployment setup process.
next-forge version
I am using version latest (commit 5823f94)
To Reproduce
Steps to reproduce the behavior:
- Go to https://vercel.com/templates/Next.js/next-forge
- Click
Deploy
to start the deployment process - Configure target user/organization and repository, then click
Create
- Notice that
CLERK_SECRET_KEY
andNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
are not present in the environment variable form - Fill in all the available environment variables
- Click
Deploy
- Build fails with environment variable validation errors for the missing Clerk variables
Expected behavior
The Vercel template should include CLERK_SECRET_KEY
and NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
as configurable environment variable fields in the deployment form, or the auth package should handle missing Clerk credentials gracefully.
Screenshots

Build error during turbo build
:
❌ Invalid environment variables: [
{
code: 'invalid_type',
expected: 'string',
received: 'undefined',
path: [ 'CLERK_SECRET_KEY' ],
message: 'Required'
},
{
code: 'invalid_type',
expected: 'string',
received: 'undefined',
path: [ 'NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY' ],
message: 'Required'
}
]
Desktop:
- OS: Linux
- Browser: Chrome
Additional Context
This is an issue with the Vercel template configuration. The template URL is missing required environment variables from its configuration, making one-click deployment impossible.
Root cause:
The Vercel template URL needs to include CLERK_SECRET_KEY
and NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
in its env
parameter list.
Fix:
Update the template URL to include these variables:
&env=...existing vars...,CLERK_SECRET_KEY,NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY