nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
641 stars 98 forks source link

[BUG] Build failing when service option `auth` is Boolean (-> Fix coming soon) #446

Closed aaharu closed 3 years ago

aaharu commented 3 years ago

Version

@nuxtjs/firebase: 7.4.0 firebase: nuxt:

Reproduction Link

Steps to reproduce

What is Expected?

What is actually happening?

in lib/plugins/services/auth.js

<% const hasOnAuthStateChangedMutation = (typeof serviceOptions.initialize.onAuthStateChangedMutation === 'string') %>
<% const hasOnAuthStateChangedAction = (typeof serviceOptions.initialize.onAuthStateChangedAction === 'string') %>
<% const hasOnAuthStateChanged = (hasOnAuthStateChangedMutation || hasOnAuthStateChangedAction) %>
<% const onIdTokenChangedMutation = (typeof serviceOptions.initialize.onIdTokenChangedMutation === 'string') %>
<% const onIdTokenChangedAction = (typeof serviceOptions.initialize.onIdTokenChangedAction === 'string') %> 
<% const hasIdTokenChanged = (onIdTokenChangedMutation || onIdTokenChangedAction) %>

Cannot read property 'onAuthStateChangedMutation' of undefined, because these lines has be put before <% if (serviceOptions.initialize) { %>

lupas commented 3 years ago

Hey @aaharu

Can you share how you configured this in your nuxt.config.js?

aaharu commented 3 years ago
services: {
      auth: true,

error occurs when auth is Boolean

lupas commented 3 years ago

Got it, will fix this asap and release a fix later today. For now - for your case - stay on v7.3.3 and you should be fine.

Thanks for the issue, appreciate it.

lupas commented 3 years ago

Fixed with v7.4.1