Skip to content

fix: check NUXT_PUBLIC_SUPABASE_* env vars before warning about missing config#587

Open
zlotnika wants to merge 1 commit intonuxt-modules:mainfrom
zlotnika:fix/suppress-false-missing-config-warnings
Open

fix: check NUXT_PUBLIC_SUPABASE_* env vars before warning about missing config#587
zlotnika wants to merge 1 commit intonuxt-modules:mainfrom
zlotnika:fix/suppress-false-missing-config-warnings

Conversation

@zlotnika
Copy link

Summary

  • Also check NUXT_PUBLIC_SUPABASE_URL and NUXT_PUBLIC_SUPABASE_KEY env vars in module defaults and before emitting missing-config warnings
  • Nuxt applies NUXT_PUBLIC_* env overrides after module setup, so the module doesn't see them and warns incorrectly

Fixes #470

@vercel
Copy link

vercel bot commented Mar 15, 2026

@zlotnika is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

…ng config

The module warns about missing `url` and `key` during setup, but Nuxt's
`NUXT_PUBLIC_*` env var overrides are applied after module setup. This
causes false warnings when users configure Supabase via
`NUXT_PUBLIC_SUPABASE_URL` / `NUXT_PUBLIC_SUPABASE_KEY`, or when module
setup runs in contexts where env vars aren't needed (e.g. `nuxt prepare`
during postinstall).

Fixes nuxt-modules#470
@zlotnika zlotnika force-pushed the fix/suppress-false-missing-config-warnings branch from 86d31f9 to 0e05b81 Compare March 16, 2026 17:10
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 16, 2026

npm i https://pkg.pr.new/@nuxtjs/supabase@587

commit: 0e05b81

joris-sevenlab added a commit to joris-sevenlab/supabase that referenced this pull request Mar 18, 2026
  The module only read SUPABASE_URL/SUPABASE_KEY from process.env at build
  time. After `nuxt build`, values were baked in and could not be overridden
  at runtime via NUXT_PUBLIC_SUPABASE_* env variables. The module also
  warned incorrectly about missing config when using NUXT_PUBLIC_* vars.

  - Use `|| undefined` instead of `as string` so empty/missing env vars
    don't block defu merges with nuxt.config.ts values
  - Remove redundant manual NUXT_PUBLIC_* reads from defaults — Nuxt
    handles this natively via runtimeConfig at runtime
  - Only fail production builds on invalid URLs, not missing ones
  - Update docs to document runtime env var names

  Fixes nuxt-modules#470
  Related: nuxt-modules#587
joris-sevenlab added a commit to joris-sevenlab/supabase that referenced this pull request Mar 18, 2026
  The module only read SUPABASE_URL/SUPABASE_KEY from process.env at build
  time. After `nuxt build`, values were baked in and could not be overridden
  at runtime via NUXT_PUBLIC_SUPABASE_* env variables. The module also
  warned incorrectly about missing config when using NUXT_PUBLIC_* vars.

  - Use `|| undefined` instead of `as string` so empty/missing env vars
    don't block defu merges with nuxt.config.ts values
  - Remove redundant manual NUXT_PUBLIC_* reads from defaults, Nuxt
    handles this natively via runtimeConfig at runtime
  - Only fail production builds on invalid URLs, not missing ones
  - Update docs to document runtime env var names

  Fixes nuxt-modules#470
  Related: nuxt-modules#587
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errant warnings when configuring with NUXT_PUBLIC_SUPABASE_KEY and NUXT_PUBLIC_SUPABASE_URL

1 participant