← Blog overview

A Simple Solution To Vercel Subdirectory Deployment Issues

For my personal website I use monorepo approach. This allows me to make quick edits to my website while having everything in the same repository.

Somewhere in the last few months, I made a mistake that made it impossible to deploy my website using the default Vercel deployment process. After a while, I gave up and contacted Vercel's support to ask for help.

After a couple of days, I received a reply with the answer to my problem. When I read the email I instantly shook my head because I never thought of looking in the most logical file.

Solution

If you have trouble deploying your website using the normal deployment process take a look in SUBDIR/.vercelignore. In my case I had the following files in there which made it impossible to deploy the application:

  • package.json
  • yarn.lock

If this isn't the problem you might want to check the "Root Directory" settings in your project settings. This should be set to the appropriate path. Which in my case is frontend.