Deploy directory 'web/web/public' does not exist

Hello!

I am building a gatsby site and I am getting the following error:

8:54:27 PM: Failing build: Failed to build site
8:54:27 PM: failed during stage ‘building site’: Deploy directory ‘web/web/public’ does not exist
8:54:27 PM: Finished processing build request in 2m16.95887541s

My settings look exactly the same as another Gatsby project that I have on netlify. The root of my gatsby project is inside web and I have the following options:

Base directory Not set
Build command gatsby build
Publish directory web/public/

Build image Ubuntu Xenial 16.04 (default)

I can build locally, on different machines too. And I see my site in web/public, so it’s confusing how it is sticking another web in the beginning of the path. Am I missing anything obvious here? It’s super confusing.

Finally found the issue, for some reason the publish setting in netlify.toml stopped working.

Old:

[build]
  base = "web/"
  command = "npm run build"
  publish = "web/public/"

New:

[build]
  base = "web/"
  command = "npm run build"
  publish = "public/"

I didn’t think I changed anything in the UI :thinking:

Good catch and glad to hear you got things working. Also, thanks so much for the follow-up! We recently launched some improvements for sites with base set but they didn’t all come off flawlessly as you noticed.

1 Like

This is confusing. The documentation (https://docs.netlify.com/configure-builds/file-based-configuration/#sample-file) explicitely states that publish is relative to the root of the repository, not base

Yikes, good catch! We’ll get those docs updated ASAP. Those are incorrect; my advice above (only for NEW sites that are using the monorepo support, as described in the “note” at the bottom of this article: https://www.netlify.com/blog/2019/10/09/launching-monorepo-support-for-netlify-sites/) should be correct.

Thanks for the quick response!
Can I opt-out the monorepo support ? I working on a fork of a repo whose site was created before October 2019 (https://github.com/apollographql/apollo-android) and I’d like to have a configuration as close as possible to the origin repo.

Sorry, no, that is not possible. All sites will be migrated to the new system at some point into the future. You should re-link the repo on your first site to get it into the “current” way of doing things if you want them to be in sync.