WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Discussion options

You must be logged in to vote

The problem is const currentUser = await getCurrentUser(); the setup function of a store must be sync. Use the current user instead. You shouldn't have a conditional return in a setup function either, it's just not meant to be used that way. What is exposed should be stable.

const currentUser = useCurrentUser()
const userDocRef = computed(() => doc(db, 'users', currentUser.value?.uid))
const user = useDocument(userDocRef)

return { user }

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@davidstackio
Comment options

@posva
Comment options

@davidstackio
Comment options

@posva
Comment options

@davidstackio
Comment options

Answer selected by davidstackio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants