Uncaught (in promise) ReferenceError: store is not defined
Hi, I'm having an issue with the Daily API. Would love some help!
When I call callObject.setUserData()
I receive the following console error:
Uncaught (in promise) ReferenceError: store is not defined
Is there any way to check whether store
exists before calling callObject.setUserData
? or another way to check that callObject.setUserData
is available to use?
The line in my code that's causing the error is as follows:
useEffect(() => {
(async () => {
if (user?.uuid && callObject) {
const userData = await getCurrentUser();
callObject.setUserData({
connectionId: connectionId,
userName: userData?.username ? userData?.username : "",
displayName: userData?.name ? userData?.name : "",
profilePic: userData?.profilePic ? userData?.profilePic : "",
userId: userData?.uuid ? userData?.uuid : "",
});
})();
}, [user, callObject]);
Attaching a photo of the full error trace. AV.tsx:81 is the line where I call callObject.setUserData, and commenting that line out removes the errors. Through tracing the code in the daily API, it seems as though there is some store
variable that does not exist when I make this call.
Answers
-
Hi @caroline , I believe you can only use
setUserData()
while you are actively in a session. Can you share more information about when you are attempting to update the user data? Is it before or after thejoined-meeting
event?0 -
Hi @daily_joey – Ahh, I was treating
callObject not null
as an indication that the meeting was joined. What is the syntax to listen for the joined-meeting event?0 -