Npm build fails with Nextjs local API giving error of "TypeError: fetch failed at object.fetch"

61 views Asked by At

I have created a basic nextjs app with new app router 13.5.6 and I am using nextjs API for backend along with Prisma. However, everything works great but it is not building with npm build and giving error of fetch failed. I am aware that this error occurs because the next server is down during build process and the app is unable to fetch data from the backend. But what is the work around of this issue. I also tried to write the backend code directly in the server component instead of sending fetch request, still no luck. If someone has solved this issue, then please help. Thank You.

enter image description here

0

There are 0 answers