pre-render error when building a next.js app

157 Views Asked by At

I am trying to build my blog app but it has a problem that I didn't understand. The app works properly when using the command npm run dev but when I build it by npm run build it gives me a prerender error.

I expected that the app will be built straitly as it does in the "dev" mode. I have tried to follow the instructions in the next.js docs by making the props have default values, and avoid "undefined" by using "null" but it simply didn't work. And I am not using (output: 'export' or next export).

0

There are 0 best solutions below