Build error Cannot find module: 'yup',"

I wanted to clarify that the issue is not related to missing dependencies on my end. The project was building fine until a recent Vercel update 2 days ago, and no changes were made to package.json or package-lock.json between the last successful deployment and the current failing one.

To confirm:

  • Locally, everything works fine, including running npm run build.
  • The yup package is correctly installed.
  • The issue only started occurring after Vercel’s update, which suggests it might be related to changes on vercel’s end.
  • Clearing cache and redeploying did not resolve the issue.

Also, is there a way to temporarily revert to the previous working build environment?

This is urgent as I am currently unable to deploy any updates to my website.

Looking forward to your support.

I see you also opened case and have already been talking with someone else from the support team.

You may be able to deploy from local build (prebuilt) since everything seems to work fine locally. But that’s just a workaround. Please continue working with your support engineer to find a permanent solution for your project.