"This question already has answers here: Fetch error when building Next.js static website in production (3 answers) Closed 3 years ago. I made an API route in the pages folder on a NextJS project. It works fine, I can fetch data from it by going to the URL directly such as http://localhost:3000/api/tv/popular. I want to fetch the data in getStaticProps and then forward to the components. It works fine if I do it this way" StachOverFlow