I have developed a Next.js app that works fine on my local machine. I am trying to deploy my app on Vercel but it keeps throwing me the error Cannot find module '@next/env'
as shown here.
I think it's because of the next-sitemap
package. I have checked my node modules and there is no env
file or folder inside the @next
folder.
I have also researched around but haven't been able to find any solution.
I have also tried deploying my app on Netlify and it throws the same error. Any help would be appreciated a lot.
UPDATE: I was finally able to solve this by updating my next.js to 10.2.3