Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass H3Event into useRuntimeConfig for serverSupabaseServiceRole #450

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

blackburn32
Copy link
Contributor

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

I'm having issues in production because my environment variables are not actually being respected. No problems locally while developing, but when I look at the values that are being pulled for serviceKey and url in production, they are not receiving the override that I expect from my environment variables. I believe this is the culprit.

Per Nuxt's documentation:

Giving the event as argument to useRuntimeConfig is optional, but it is recommended to pass it to get the runtime config overwritten by environment variables at runtime for server routes.

I have tested this using patch-package and confirmed that doing this fixes the behavior.

Is this a bad idea for some reason I'm not aware of?

I'm having issues in production because of this. My environment variables are not actually being respected. Per Nuxt's documentation: https://nuxt.com/docs/guide/going-further/runtime-config#server-routes

> Giving the event as argument to useRuntimeConfig is optional, but it is recommended to pass it to get the runtime config overwritten by environment variables at runtime for server routes.
Copy link

netlify bot commented Jan 15, 2025

👷 Deploy request for n3-supabase pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit a4f1041

@larbish larbish merged commit 2de1c08 into nuxt-modules:main Jan 20, 2025
1 check passed
@larbish
Copy link
Collaborator

larbish commented Jan 20, 2025

It's a good fix and good practice thanks!

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.

2 participants