Locally, I use yarn to create my dev using yarn dev and yarn build. Both work fine locally with no errors. I have created two netlify.toml files because another thread mentioned this was a possible solution. This is a nextjs project using the Ghost Content API, if that has any relevance.
When I try to build, the yarn build command runs repeatedly before resulting in a ton of errors and fails. The link to the log is here: Netlify App
I would copy+paste the log but I reach the max character limit when trying to do so. If you need the full log, I can email or post it somewhere else.
See your build command… it’s just yarn build. So, what’s happening is your build is stuck in a loop. yarn build is calling for yarn build which is again calling yarn build. Replace that part with your actual build command and it should work.
That means your publish directory is wrong. Try building locally once to see where you’re getting the buid files. Then use that folder as publish path.
You’re running a development server, which is not supported on Netlify. You need to generate static HTML, CSS, JS files. I guess, in NextJS, the command is next build && next export. The tutorial that you mentioned might be outdated, thus the confusion.
Thank you so much for the help. I’ve added next export to my package.json and that seems to have solved the issue. I also noticed that the plugins recommended on the previous article I mentioned also causes a conflict with nextjs projects. So yes, that article seems to be outdated.
Would you be able to post your full package.json? Additionally, can you elaborate on what is outdated in the article above? I want to make sure I can look into that on your behalf.