vuejs / vuefire

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

[nuxt-vuefire] Using ssr: false and auth: true gets error: Cannot find package 'firebase-admin' #1389

Closed davidstackio closed 11 months ago

davidstackio commented 11 months ago

Reproduction

https://github.com/davidstackio/nuxt-test

Steps to reproduce the bug

  1. Initialize the repo with your firebase configuration. NOTE: auth must be enabled in nuxt.config.ts for vuefire
  2. run npm run dev
  3. Get the error ERROR [worker reload] [worker init] Cannot find package 'firebase-admin' imported from C:\Users\David\Documents\GitHub\nuxt-test\.nuxt\dev\index.mjs

Expected behavior

No error. Since I'm not using SSR, the firebase-admin package (and dependencies) should not be needed.

Actual behavior

Get this error: ERROR [worker reload] [worker init] Cannot find package 'firebase-admin' imported from C:\Users\David\Documents\GitHub\nuxt-test\.nuxt\dev\index.mjs

Additional information

This used to work on nuxt-vuefire v 0.2.0 before I upgraded to v 0.2.6. It works without error using nuxt-vuefire v 0.2.0 and vuefire v 3.1.7, so the issue seems to be with just the nuxt-vuefire package v 0.2.6 (you may have to restart the server to allow Nuxt to optimize the dependencies if you downgrade to fully remove the error).