I have a problem with the build. First of all, I am new to Next Js. When I enter npm run build, I get this error
> Build error occurred
Error: Export encountered errors on following paths:
/
/blog
/ourWorks
/services
I searched Google for this problem and found fallback: false and tried in my code, but it did not work. I think the reason is for getStaticProps
One of my component (path /services):
services/index.js
export async function getStaticProps() {
const res = await fetch("http://localhost:3000/api/servicesApi/");
const posts = await res.json();
return {
props: {
posts,
},
};
}
my package.json
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},