Getting the weird error when deploying the nextjs14 application to the vercel (screenshot attached)
Answered
Spid€r posted this in #help-forum
Spid€rOP

im using nextj14, prisma and nextauth for the authentication
the codebase [link ](https://github.com/spider076/Cedium)
please help me solve this weird bug
### Example
No response
### Steps to Reproduce
the deployed application link : [https://cedium.vercel.app/](https://cedium.vercel.app/)
these are the website vercel logs :

im using nextj14, prisma and nextauth for the authentication
the codebase [link ](https://github.com/spider076/Cedium)
please help me solve this weird bug
### Example
No response
### Steps to Reproduce
the deployed application link : [https://cedium.vercel.app/](https://cedium.vercel.app/)
these are the website vercel logs :

Answered by joulev
Do not fetch your own route handlers in server components. https://nextjs-faq.com/fetch-api-in-rsc
28 Replies
@Spid€r 
im using nextj14, prisma and nextauth for the authentication
the codebase [link ](https://github.com/spider076/Cedium)
please help me solve this weird bug
### Example
_No response_
### Steps to Reproduce
the deployed application link : [https://cedium.vercel.app/](https://cedium.vercel.app/)
these are the website vercel logs :

It looks like your app can't connect to somewhere. Try checking the accessabilty from your database server (for example) and also check your credentials
@Spid€r all env's are well connected
try to build your project locally using
vercel build and vercel start Let's see, if there are errors as well@Spid€r Click to see attachment
the
Database_url contains no variables, right?@B33fb0n3 the Database_url contains no variables, right?
Spid€rOP
it contains neon db's postgress connection url
@B33fb0n3 try to build your project locally using vercel build and vercel start Let's see, if there are errors as well
Spid€rOP
on running it i got the invalid_url error
Spid€rOP
yup tq for the assistance
Spid€rOP
solved this error by following this : https://next-auth.js.org/configuration/options
the website content appears for a micro second and the same error comes back
have also wrapped the page with suspense component
this is the errror in my vercel dashboard logs :
@Spid€r 
im using nextj14, prisma and nextauth for the authentication
the codebase [link ](https://github.com/spider076/Cedium)
please help me solve this weird bug
### Example
_No response_
### Steps to Reproduce
the deployed application link : [https://cedium.vercel.app/](https://cedium.vercel.app/)
these are the website vercel logs :

Do not fetch your own route handlers in server components. https://nextjs-faq.com/fetch-api-in-rsc
Answer
Spid€rOP
but i dont see this errors on running vercel build command
@Spid€r you mean like : ?
Yes. Don’t do this.
Spid€rOP
a'right got it
gotta follow the docs u provided, will update if it succeds
@Spid€r you mean like : ?
Spid€rOP
i can do this on my client component right ?
Yes, though you won’t need to use the domain in that case. Just fetch("/api/…") already works.
If you find yourself doing fetch("http://localhost:3000/…") you are likely doing it wrong.
If you find yourself doing fetch("http://localhost:3000/…") you are likely doing it wrong.
here im not directly using the fetch to retrive the blogs in the ListBlogs function, im calling it outside of the function
does this also cause error ? i found in an youtube video that this is best approach to call any api from the server component
@Spid€r does this also cause error ? i found in an youtube video that this is best approach to call any api from the server component
That YouTube video is just plain wrong. The error you are encountering is a proof of that. Don’t trust everything you see on YouTube.
Refactor your code so that you don’t fetch() your own route handlers. Just run the server side logic directly.
Refactor your code so that you don’t fetch() your own route handlers. Just run the server side logic directly.