API is failing in server components but working in client components #69998
Unanswered
vinitgundeti
asked this question in
Help
Replies: 1 comment 1 reply
-
@vinitgundeti I am not able to replicate this issue (it's unlikely that it's related to Next.js). How often are you experiencing this issue? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Link to the code that reproduces this issue
https://github.com/vinitgundeti/peps-api-fail
To Reproduce
Create a server component.
Call api in server component
Server Component
apiCall Function
Current vs. Expected behavior
Current
Api is failing in server component. But working in client components. And this is random, sometimes API is working in server component as well.
Provide environment information
next: "14.2.9" node: v18.20.3 npm: v10.7.0 macOS: 14.5
Which area(s) are affected? (Select all that apply)
Developer Experience, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), Vercel (Deployed)
Additional context
API failing randomly in sever component, means it works sometimes and fails sometimes but when i checked same api in client component, it is working every time
This is the api : https://pepsindia.in/api/get-home-content
Beta Was this translation helpful? Give feedback.
All reactions