Next 14 | Server Actions being spammed
Unanswered
Asian black bear posted this in #help-forum
Original message was deleted.
19 Replies
Shy Albatross
you're misusing server actions, that's why
Server actions are designed for mutations that update server-side state; they are not recommended for data fetching.https://react.dev/reference/react/use-server
also I assume that Next/React has no way of knowing if
prisma.status.whatever
is stable (contrary to fetch, which it expects to be stable based on URL, params and headers, therefore it caches it) so your component that awaits getStatus() rerenders forever?delete the "use server" because there's no reason to go over HTTP when wanting to fetch data between a server function and a server component
wdym prisma can't run
it's still on the server even after you remove "use server"
that's not a next error, that's a prisma error, maybe prisma doesn't support next 14 yet
running in 'unknown'
so prisma doesn't support RSC?
hard to say, their article and demo for RSC are outdated
no "use server" here
status is a client component? you failed to include that in the OP
there's no "use client" there
well then I suspect the issue is that the component awaits something that doesn't look like it stabilises so it keeps rerendering forever
at least with an API route you will be aware that you need to secure it somehow
Shy Albatross
I'd like to point out that it's odd that your whole page is a client component
Shy Albatross
exactly