Getting 500 error instead of 404

Hi Developers,

I am using nextjs site with netlify. but I am getting 500 errors on a not found page.
image

this is the screenshot of netlify odb handler function. but everything is working fine on localhost and vercel. the problem is on the netlify only,

this is the netlify link: https://tf-next-test.netlify.app/
and this is vercel link: https://tf-next-test.vercel.app/

Hey there, @tfsomrat :wave:

Thanks for reaching out! Sorry to hear you are encountering obstacles. Can you please share your project repo that corresponds with this site? This will help us look into your set up a bit more closely.

Hello @hillary

I am sorry for the late reply, I was a little busy exploring Nextjs and Netlify. I cannot share the project repo because of company policy. but I have created another project which has the same issue.

here is the repo: Somrat / next-boilerplate ยท GitLab
and also the live demo: https://tf-next-boilerplate.netlify.app/
getting 500 instead of 404: https://tf-next-boilerplate.netlify.app/test

:wave: @tfsomrat , this blog post walks through how to resolve the path to any additional files that should be included in the function deployment during build: How to Include Files in Netlify Serverless Functions

Let us know if that helps or we should keep digging! :slight_smile: