Getting an error when building a next project

57 Views Asked by At

I have a nextjs project that I call a fake api like jsonplaceholder. everything is ok when I run dev and start it's build.

If i change the the api address to the wrong one in purpose, I get error and redirect me to the error page in development mode.

But when i try to build it i get an error that say :

Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error fetch data function

call function to get data

the error i get

I want to build project without error even with wrong api address. what should i do? I would appreciate it if you help me to solve this problem.

0

There are 0 best solutions below