vuejs / vuefire

🔥 Firebase bindings for Vue.js
https://vuefire.vuejs.org
MIT License
3.82k stars 323 forks source link

VueFire on nuxt3 does not use runtime environment variables #1360

Closed SamGeens closed 1 year ago

SamGeens commented 1 year ago

Reproduction

Run vuefire with an at runtime api key does not work

Steps to reproduce the bug

  1. Setup the config in nuxt.config.ts as follows:

    modules: [
    'nuxt-vuefire',
    ],
    
    vuefire: {
    auth: true,
    config: {
      apiKey: process.env.NUXT_PUBLIC_VUEFIRE_API_KEY,
      authDomain: process.env.NUXT_PUBLIC_VUEFIRE_AUTH_DOMAIN,
      projectId: process.env.NUXT_PUBLIC_VUEFIRE_PROJECT_ID,
    },
    },
  2. Run the app with the environment variables

Expected behavior

I expect vuefire to use the NUXT_PUBLIC_VUEFIRE_API_KEY environment variable at runtime.

Actual behavior

The apps shows an empty screen. Which is the exact same behaviour as running the app without api key. Which suggests that the key can't be found at runtime.

Additional information

No response