'Nextjs build issue on vercel

I have a small Nextjs application. I have the 'pages' folder in the root. When i run 'npm run build' i get the '.next' folder which is also in the root.

If i go to ./.next/server/pages there are none of the files which i created in the 'pages' folder in the root.

When i try to access the folder in production on Vercel, i only have a 404.html file in there.

I try to access alle the pages with fileSystem in order to build a sitemap but if there are no files in .next/server/pages folder. The appilication runs smoothly otherwise, i just cant locate the files.

My thoughts were maybe i needed to do some build configuration or something? In order ot make sure all files end up the that folder?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source