Hey, I'm currently working a nextJs projekt with appwrite and tried to connect to the 'account' channel but im not getting any response even on changes. After initial load i have opened another tab where i make changes to the user but nothing came in the page component. On the network tab there is the realtime connection pending but has no data and after a while its fail and try to esteblish a new connection.
'use client'
import React, { useEffect, useState } from 'react'
import { Client, Account } from 'appwrite';
import Connection from '@/lib/appwrite';
const Page = () => {
const client = Connection();
const account = new Account(client);
const [user, setUser] = useState<any>(null);
useEffect(() => {
const fetchUser = async () => {
try {
const userData = await account.get();
setUser(userData);
} catch (error) {
console.error('Error fetching user:', error);
}
};
fetchUser();
const unsubscribe = client.subscribe('account', (response) => {
console.log('Account update received:', response);
fetchUser();
});
return () => unsubscribe();
}, []);
return (
<div>Page asd</div>
)
}
export default Page
Recommended threads
- Android SDK: Kotlin null Value Not Updat...
Hi team, I think you should check the Android SDK implementation once, as it seems to have an issue handling Kotlin **null** values. For example: When I send:...
- Can't connect GitHub — 500 error at the ...
Appwrite Cloud, Pro plan, SFO region. All my Git connections vanished today — Sites and all 15 Functions now show no repository connected. When I try to add a ...
- GB Hours IS NOT resetting
Hi, I was checking my usage and noticed that all of my usage quotas were reset on August 20, 2026, when my billing cycle renewed. Everything else appears to ha...