Currently, I am attempting to implement VueFire's useCurrentUser() function within a Nuxt 3 application that does not utilize Server Side Rendering.
I have properly configured vuefire in my nuxt.config.ts file as outlined in the documentation.
export default defineNuxtConfig({
modules: ['nuxt-vuefire',],
vuefire: {
config: {
apiKey: '...',
authDomain: '...',
projectId: '...',
appId: '...',
},
},
})
Within app.vue, I have implemented the code as recommended in the VueFire documentation:
<script setup>
const router = useRouter()
const route = useRoute()
const user = useCurrentUser()
onMounted(() => {
watch(user, (user, prevUser) => {
if (prevUser && !user) {
// user logged out
router.push('/login')
} else if (user && typeof route.query.redirect === 'string') {
// user logged in
router.push(route.query.redirect)
}
})
})
</script>
However, I keep encountering the same error message:
**
[VueFire] useCurrentUser() called before the VueFireAuth module was added to the VueFire plugin. This will fail in production.
**
I appreciate any assistance you can provide. Thank you