fix: check NUXT_PUBLIC_SUPABASE_* env vars before warning about missing config#587
Open
zlotnika wants to merge 1 commit intonuxt-modules:mainfrom
Open
Conversation
|
@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
86d31f9 to
0e05b81
Compare
commit: |
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
4 tasks
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NUXT_PUBLIC_SUPABASE_URLandNUXT_PUBLIC_SUPABASE_KEYenv vars in module defaults and before emitting missing-config warningsNUXT_PUBLIC_*env overrides after module setup, so the module doesn't see them and warns incorrectlyFixes #470