Next.js Discord

Discord Forum

Vercel system env not working?

Unanswered
Pacific thread herring posted this in #help-forum
Open in Discord
Pacific thread herringOP
Hi!
I've set the following in my .env


But on the page, it just shows as:
VERCEL_GIT_COMMIT_SHA

And in the code
                  {(process.env.NEXT_PUBLIC_GIT_COMMIT_ID || process.env.VERCEL_GIT_COMMIT_SHA) && (
                    <span className="font-mono border border-border/40 px-1.5 py-0.5 rounded">
                      {t("version")}: {(process.env.NEXT_PUBLIC_GIT_COMMIT_ID || process.env.VERCEL_GIT_COMMIT_SHA || '').slice(0, 7)}
                    </span>
                  )}


But on the page, I either see

Version: VERCEL_

Or
Version: VERCEL_GIT_COMMIT_SHA

What am I doing wrong? 😦

0 Replies