NextJs vercel deployment error "routes-manifest.json" couldn't be found

Viewed 1839

My nextjs app was working properly I added some files to update my code now it is not deploying my app on vercel. gives this error

enter image description here

I tried googling the error but my case in unique.

This is the git repo https://github.com/usman-174/google-calendar-frontend

These are my script tags from package.json

 "scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"export": "next export",
"lint": "next lint",
"lint-fix": "next lint --fix"
},

next.config.js

module.exports = {
distDir: 'build',
}
2 Answers
  1. Run npm run build (check all files in builded folder)
  2. Create .next folder and move all files from build folder to .next
  3. Commit your .next folder to vercel or maybe git.

I also ran into this error because the root directory of my app was not in the top-level directory of my Git repository, so Vercel was unable to find the .next folder.

I fixed it by going to the Vercel dashboard for my Vercel project, then -> Settings -> General and setting Root Directory to the subdirectory path to my application: enter image description here

Related