Vercel deploy --prebuilt now requiring access to Root Directory?

Hi, our CI/CD process process stopped working suddenly sometime in the last week. I’m wondering if something changed around the cli deploy command recently that would cause this?

Our GH workflow does a fairly simple setup:

CI job:

  • Checks out repo
  • Runs vercel pull
  • Runs vercel build
  • Uploads the .vercel output as a artifact

CD job:

  • Downloads artifact
  • Runs vercel pull
  • Runs vercel deploy --prebuilt

This has worked fine up until last week. Nothing about our workflow has changed, but vercel deploy suddenly started throwing this error:

Run url="$(vercel deploy --prebuilt --token=*** )"
Vercel CLI 39.1.0
Retrieving project…
Error: The provided path “~/work/repo/repo/root/dir” does not exist. To change your Project Settings, go to https://vercel.com/...

root/dir is what we have configured as our Root Directory under the project’s settings. The error is correct that the directory isn’t there, but that source folder shouldn’t be needed, if I understand correct? All of the needed build output would be in the .vercel output folder, which lies at our monorepo root.

hey @sagewlivingstone, good question!

Is this error occurring within the Github CI/CD pipeline, locally or both?

“I’m wondering if something changed around the cli deploy command recently that would cause this?”
I haven’t seen any changelogs that would affect this. Generally Vercel CLI commands should remain stable unless changing to a new major version.

Error: The provided path “~/work/repo/repo/root/dir” does not exist. To change your Project Settings, go to https://vercel.com/...

It looks like your project’s Root Directory has been set to an absolute path instead of a relative path. I’m guessing this because I noticed ~/work which looks like a local folder on your personal machine.

Generally you want to define this from the context of the repository itself. So maybe I have a monorepo with 3 different apps:

my-repo
├── apps
│   ├── app-1
│   ├── app-2
│   └── app-3
└── lib

Let’s say we’re trying to deploy app-1. Our Root Directory should be set to:

apps/app-1

This informs Vercel that the only code and dependencies we care about when deploying app-1 live in that folder. We can even enable the Skip Deployments toggle to prevent unnecessary builds:

Maybe app-2 is similar but it also requires custom shared dependencies which live in the lib folder. In that case we would need to enable the Include files outside the root directory in the Build Step option too.

You can find these options within the dashboard under Project Settings. The Configuring a Build docs have more details.

Feel free to tag me or raise a case if you have any questions :v:

2 Likes

hi @aldovercel thanks for the response!

Yes, this is occurring on GitHub actions runners, hadn’t tested locally.

It looks like your project’s Root Directory has been set to an absolute path instead of a relative path. I’m guessing this because I noticed ~/work which looks like a local folder on your personal machine.

Nope, ~/work/ is just where GH Actions runners default their working dir to. My Root Dir is not set to an absolute path. Here’s what my project settings look like: (anonymized of course)

I haven’t seen any changelogs that would affect this. Generally Vercel CLI commands should remain stable unless changing to a new major version.

Is this for sure? I did some testing locally to try to reproduce:

vercel build
rm -rf root/dir # (to simulate what the gh worker sees - it only has access to .vercel/)
vercel deploy --prebuilt

Results in:

Vercel CLI 34.3.1
🔍  Inspect: https://... # correct link to working deploy

Updating to latest cli version:

pnpm i -g vercel@latest
vercel deploy --prebuilt

Now throws the error:

Vercel CLI 39.1.0
> NOTE: The Vercel CLI now collects telemetry regarding usage of the CLI.
> This information is used to shape the CLI roadmap and prioritize features.
> You can learn more, including how to opt-out if you'd not like to participate in this program, by visiting the following URL:
> https://vercel.com/docs/cli/about-telemetry
Error: The provided path “C:\company\repo\root\dir” does not exist. To change your Project Settings...

Looking back at our deploy logs, the last successful deploy we had was still on the same major version, but a few versions back. Seems it was working on 39.0.1:

$ pnpm i -g vercel@39.0.1
$ vercel deploy --prebuilt
Vercel CLI 39.0.1
🔍  Inspect ...

I’ll be locking our CD runners to 39.0.1 until this is resolved. Lmk if there’s any updates, thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.