<pectus.ai/>
./pectus.ai — builder framework · self-hosted · MIT

For end users

The CMS won't start. It says "Your project's URL and Key are required to create a Supabase client!"

FAQ /Install

This is the most common step-9 error. It means the Next.js CMS started but couldn’t find your Supabase URL and anon key in environment variables. Three causes; check in this order.

1. The variable names in .env.local don’t match what the CMS expects

Open .env.local at the install root (the same folder pectus.md is in, not inside cms/). The Supabase entries must be named exactly these:

NEXT_PUBLIC_SUPABASE_URL=https://xxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
SUPABASE_SERVICE_ROLE_KEY=eyJ...

Common mistakes the install agent sometimes makes:

  • Wrote SUPABASE_URL instead of NEXT_PUBLIC_SUPABASE_URL. Next.js only exposes variables prefixed with NEXT_PUBLIC_ to client code.
  • Wrote SUPABASE_ANON_KEY instead of NEXT_PUBLIC_SUPABASE_ANON_KEY.
  • Used quotes around the values. Don’t quote the values; use bare strings.

.env.example at the install root has the canonical list. If your .env.local doesn’t match those names character-for-character, fix it.

2. The dev server was started before .env.local was finalized

Next.js reads environment variables once at server start. If npm run dev was running while you were still adding values to .env.local, the running process has stale env (or no env at all).

Fix:

  1. In the terminal that’s running the CMS, press Ctrl-C to stop it.
  2. Confirm .env.local has all three Supabase values.
  3. Run npm run dev again.

3. .env.local is in the wrong folder

It must be at the install root (next to pectus.md, package.json), not inside cms/. Pectus’s npm workspace setup picks it up from the root.

If you find a .env.local inside cms/, move its contents into a .env.local at the install root and delete the inner one.

After any fix

Restart the dev server. Open http://localhost:3000. The error should be gone and you’ll land on the login page.

If the error persists, paste the contents of .env.local (with the actual values redacted; just the variable names and = signs) at your install agent. The agent can spot the mismatch in seconds.