Next.js Discord

Discord Forum

Data fetching error in a server component

Unanswered
Chausie posted this in #help-forum
Open in Discord
ChausieOP
I came across a problem that I am fetching data in a server component in next.js and it requires absolute url and I know the absolute url on my localhost i.e http://localhost:3000/....
Everything works fine till here. But when I try to deploy the site then it gives me error as it is no longer on my localhost. So what can I do with the url to fetch data on the server side.

2 Replies