Server actions called from useEffects don't resolve...
Answered
American Sable posted this in #help-forum
American SableOP
Version: 13.5.2
Example:
On first load, all of the console logs fire. Any switching of the organization (from clerk's useOrganization) will trigger both USE EFFECT logs, but only the START for GET ROOMS. This does not happen on 13.4.19. Anyone else encountering this? Its like the promise doesn't resolve???
Link to file (issue arises if you checkout and update to 13.5.x): https://github.com/atridadl/Atash/blob/main/app/(client)/dashboard/RoomList.tsx
Example:
const getRoomsHandler = async () => {
console.log("GET ROOMS START");
const dbRooms = await getRooms();
console.log("DB ROOMS", dbRooms);
setRoomsFromDb(dbRooms);
console.log("GET ROOMS END");
};
...
useEffect(() => {
console.log("USE EFFECT START");
getRoomsHandler();
console.log("USE EFFECT END");
}, [organization]);On first load, all of the console logs fire. Any switching of the organization (from clerk's useOrganization) will trigger both USE EFFECT logs, but only the START for GET ROOMS. This does not happen on 13.4.19. Anyone else encountering this? Its like the promise doesn't resolve???
Link to file (issue arises if you checkout and update to 13.5.x): https://github.com/atridadl/Atash/blob/main/app/(client)/dashboard/RoomList.tsx
Answered by American Sable
I was going to do this... but it's fixed in the newest canary
6 Replies
American SableOP
Just an update: still an issue with the latest canary
American SableOP
Aaaaaand same thing with canary 1 😦
I feel like someone else had to have encountered this... or I'm doing server actions all wrong
I feel like someone else had to have encountered this... or I'm doing server actions all wrong
American SableOP
Figured I'd update with this:
Link with broken server actions: https://atash-71k4pzo72-atridadl.vercel.app/dashboard
Link with working server actions: https://atash.atri.dad/
Link with broken server actions: https://atash-71k4pzo72-atridadl.vercel.app/dashboard
Link with working server actions: https://atash.atri.dad/
American SableOP

European sprat
Make a minimal reproduction
American SableOP
I was going to do this... but it's fixed in the newest canary
Answer