So I have created a Nextjs 14 application in Javascript and its staging environment is deployed on Vercel while the production environment is on AWS Amplify.
I am using next-pwa to convert this application to a PWA.
When I run npm run build and npm run start on local machine it is working fine, but giving issues on both staging and production servers.
Error on Vercel:
Error: The file "/vercel/path0/.next/routes-manifest.json" couldn't be found. This is often caused by a misconfiguration in your project.
Error on AWS Amplify:
[ERROR]: !!! CustomerError: Can't find required-server-files.json in build output directory
Changes I did:
I tried changing the configuration of next.config.js but it is not working as expected. I also did some tweaks in my manifest file and Next.js 14 metadata configuration but no luck