Nuxt Supabase error
Missing NUXT_PUBLIC_SUPABASE_URL, set it in .env or via runtimeConfig.public.supabase.url in nuxt.config.ts.
"Missing NUXT_PUBLIC_SUPABASE_URL, set it in .env or via runtimeConfig.public.supabase.url in nuxt.config.ts." is a warning from @nuxtjs/supabase 2.1.0 when Nuxt loads the module and neither NUXT_PUBLIC_SUPABASE_URL nor SUPABASE_URL is set. The page then answers HTTP 500 with "Your project's URL and Key are required to create a Supabase client!". Add NUXT_PUBLIC_SUPABASE_URL and NUXT_PUBLIC_SUPABASE_KEY in Vercel for Production and Preview, then redeploy. The plain SUPABASE_URL and SUPABASE_KEY names count only when they exist while nuxt build runs. Module 1.x printed "Missing supabase url, set it either in nuxt.config.ts or via env variable". Reproduced with @nuxtjs/supabase 2.1.0 on 2026-10-31.
Which environment variables does @nuxtjs/supabase read?
The module code comment gives the order: NUXT_PUBLIC_* and NUXT_* first (recommended), then the SUPABASE_* names as a legacy fallback. In the 2.1.0 package the URL comes from NUXT_PUBLIC_SUPABASE_URL or SUPABASE_URL. The key comes from NUXT_PUBLIC_SUPABASE_KEY, SUPABASE_KEY, SUPABASE_PUBLISHABLE_KEY, SUPABASE_ANON_KEY, NUXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY or NUXT_PUBLIC_SUPABASE_ANON_KEY. The secret key comes from NUXT_SUPABASE_SECRET_KEY, SUPABASE_SECRET_KEY or SUPABASE_SERVICE_ROLE_KEY, and it lives in private runtime config, not in public.
NUXT_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co
NUXT_PUBLIC_SUPABASE_KEY=your-publishable-key
NUXT_SUPABASE_SECRET_KEY=your-secret-key # server only, only if server code needs itWhy does Nuxt still return 500 after I set SUPABASE_URL in Vercel?
The module reads the plain names when it loads, during the build, and copies them into the build. In a run on 2026-10-31 with the Node server preset: a build with no variables returned 500 even when SUPABASE_URL and SUPABASE_KEY were set at start-up; the same build returned 200 when NUXT_PUBLIC_SUPABASE_URL and NUXT_PUBLIC_SUPABASE_KEY were set at start-up; and a build made with SUPABASE_URL and SUPABASE_KEY present returned 200 with nothing set at start-up. So a plain name works only if it was in the environment of that build, which on Vercel means it was selected for that deployment's environment before the deployment started.
build without variables, then start with:
SUPABASE_URL + SUPABASE_KEY HTTP 500
NUXT_PUBLIC_SUPABASE_URL + NUXT_PUBLIC_SUPABASE_KEY HTTP 200
NUXT_PUBLIC_SUPABASE_URL only HTTP 500What is the error for a missing Supabase secret key?
In the 2.1.0 package, serverSupabaseServiceRole throws "Missing server key. Set NUXT_SUPABASE_SECRET_KEY in your environment variables." when server code asks for a service client and no secret key is set. The old SUPABASE_SERVICE_KEY name still loads but logs a deprecation warning that points to NUXT_SUPABASE_SECRET_KEY. For the same URL and key problem in a Next.js app, see the Next.js version.
Checklist
How to fix it, then check the fix
- 01Find where the app and the template name the Supabase variables:
grep -rnE "SUPABASE" nuxt.config.ts .env.example server app - 02Add the public pair in Vercel for each environment that builds or runs the app:
vercel env add NUXT_PUBLIC_SUPABASE_URL production vercel env add NUXT_PUBLIC_SUPABASE_KEY production vercel env add NUXT_PUBLIC_SUPABASE_URL preview vercel env add NUXT_PUBLIC_SUPABASE_KEY preview - 03Add NUXT_SUPABASE_SECRET_KEY only if server code uses a service client, and never under a NUXT_PUBLIC_ name.
- 04List the same names, with no values, in .env.example.
- 05Redeploy, because Vercel applies changed variables only to new deployments. Then check that the build log has no line starting with "Missing NUXT_PUBLIC_SUPABASE" and that the home page answers 200, not 500.
Related
Related guides
Sources
Official docs behind this checklist
Browse all launch guides · Read resources · How to make and check your next change
FAQ
FAQ for builders before launch
Is the 1.x message the same problem?
Yes. Versions 1.6.2 and 2.0.0 of the package print "Missing supabase url, set it either in nuxt.config.ts or via env variable" under the same condition, and the key has its own separate message. Version 2.1.0 names the variable in the text.
Can I keep the SUPABASE_URL names from the Vercel integration?
Yes, if they are present when the build runs: the module reads SUPABASE_URL and SUPABASE_KEY as a fallback. Setting the NUXT_PUBLIC_ names as well lets the values change at start-up without a rebuild.