Next.js Fetching issue
Unanswered
Great golden digger wasp posted this in #help-forum
Great golden digger waspOP
Hello,
I have a problem with my code when I am fetching data with useEffect (https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#useeffect) my Computed Time on vercel DB is okay but when I change my fetch to server components (https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#server-components) my Computed Time goes up like crazy... Like 0.05h in every 10 minutes... This is just crazy.... I changed my app to use server components like 4-5 days ago and it cost like 6h per day Computed Time.... With useEffect it was like 1.5h per day...
I have a problem with my code when I am fetching data with useEffect (https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#useeffect) my Computed Time on vercel DB is okay but when I change my fetch to server components (https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#server-components) my Computed Time goes up like crazy... Like 0.05h in every 10 minutes... This is just crazy.... I changed my app to use server components like 4-5 days ago and it cost like 6h per day Computed Time.... With useEffect it was like 1.5h per day...
2 Replies
Great golden digger waspOP
But I want to fetch data with server because I do not have loading states for users and it looks better... Can someone please help me what is wrong?
useEffect: https://pastebin.com/bkp6FAyp
Server component: https://pastebin.com/sAjhEXwf
useEffect: https://pastebin.com/bkp6FAyp
Server component: https://pastebin.com/sAjhEXwf
Great golden digger waspOP
I have about 8-9 components like this, but even if I redo just one, it does the same thing with Compute Time...