I am currently trying to publish a nextJS site to netlify, but it shows a 404, link here:
It is a mono-repo with a root, that contains frontend and backend folder:
** backend →
** frontend →
So in the netlify UI I changed the base directory to “frontend”. And Publish Directory to “frontend/.next”
It is installing the dependencies and the “tree” during build that comes up when building next apps can also be seen in the logs.
I already tried to use the two variations of build command mentioned in the documentation for monorepos. It is not helping.
When i download the directory I can see that there is no index.html.
Thanks in advance
Thanks for reaching out and welcome to the Netlify Support Forums!
We have a general Support Guide on Page Not Found errors here that may help:
Last reviewed by Netlify Support - August, 2023
Netlify attempts to lookup a file based on several xor filters, and when all of these fail, we end up serving a 404 page. For example, a request made to /example/ would check /example/index.html, /example.html, /example/home.html and several other combinations (not necessarily in the same order) before hitting the 404. However, in case you were not expecting a 404 at a particular URL, you might be interested in finding out the reason and potentia…
I also found this recent post with a similar
issue, if you could try clarnx’s suggesting if the first Support Guide doesn’t help.
If you have any questions, please let us know.
Thank you for the response and the links.
I am afraid non of these helped, I looked at them beforehand and checked again now, but I still would not know what I did wrong.
I have a different site deployed on netlify (also with nextjs) and whenenver I download that, there is a index.html file created in the zip. On this repo no index file is created, but I can not find out why. I think that this is the problem
If those suggestions did not work, can you please share your repository as well as your most recent deploy log? We will need those details in order to investigate further.
Hello. Please I am having the same issues with my project. I deployed my project and have tried several suggestions but it is still showing 404 page not found
@veedahv , welcome,
Kindly read @Melvin’s reply in this post above or click on the link at 404 on nextjs deployment - #2 by Melvin
If the above does not work kindly share a snippet of your build logs for me to debug the reason for the 404 not found.