Hi @nbouvrette, thanks for the extra information.
I took at your repository and then tested it. It deploys as expected.
However I realized the error is coming from the homepage at pages/index.tsx/
Other pages work as expected.
Kindly take your time and then go through your code in pages/index.tsx/. You can narrow down the error by either console.log() expected variables to see if they are actually being returned or start the page as a blank page and add content incrementally to see which additions causes the error.
You can access your server side logs by checking the function logs in the Netlify UI dashboard.
In the dashboard click on your site and then at the top menu you should see the functions menu.
Once you click on the functions menu select the function called __netlify-handler
While __netlify-handler is waiting for requests, visit the homepage link where you receive the 500 error.
You will see all the errors displayed in the __netlify-handler logs.
ERROR Error: cannot find the Next.js pages directory
Once of the errors in the functions log is the quoted text above.
Kindly fix the errors in the functions log.
Also if you want to see the errors displayed in your console on local development you need to deploy your site using Netlify CLI.
Kindly find more information in the link below.
Did you find this in the logs or you used this as an example?
Because I already checked the __netlify-handler logs and all the other logs I could find on the dashboard, and I tried to trigger them by navigating on the homepage and they are all empty… this is why I was asking for help originally.
Are you able to get the logs for the homepage error on your side?
@nbouvrette, Even though Next.js 13 is stable, at this point there will be problems if it’s not configured properly since it is was released not long ago.
Also since it fairly new there will be some incompatibility issues for sure. That is why I recommended you use Next.js 12 to see if the problem persists.
Another way to mitigate possible errors is to create a minimal production of your site.
Is there a reason why you are not using the new Next.js 13 app directory?
At this point the errors in the function logs could help.
Also try to deploy on local development with Netlify CLI to see the errors in your terminal or console application.
Good news, I fixed it simply by making the pages check asynchronous… I have no idea what is going on with your instances that don’t have a pages directory so if you have more details I would be happy to learn anything on that front.
Otherwise, thanks for helping me find the logs and a solution!