sanity-io / example-company-website-gatsby-sanity-combo

This is an example company website using Gatsby and Sanity in combination.
https://example-company-website-gatsby-sanity-combo.now.sh
MIT License
274 stars 141 forks source link

Site deploy fails to build with "failed during stage 'building site': Deploy directory 'web/web/public' does not exist" #211

Open judepark opened 4 years ago

judepark commented 4 years ago

Hello - I am trying to build a new site using the repo using netlify. I followed the instructions from "https://www.sanity.io/blog/how-to-quickly-set-up-a-gatsby-js-jamstack-website-with-a-headless-cms" but site fails to build with the message

"failed during stage 'building site': Deploy directory 'web/web/public' does not exist"

This is the full Netlify deploy job:

9:03:55 AM: Build ready to start
9:04:16 AM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
9:04:16 AM: build-image tag: v3.3.2
9:04:16 AM: buildbot version: a2bab682ae0761baa4d123ebd00c57be933655dc
9:04:17 AM: Fetching cached dependencies
9:04:17 AM: Failed to fetch cache, continuing with build
9:04:17 AM: Starting to prepare the repo for build
9:04:17 AM: No cached dependencies found. Cloning fresh repo
9:04:17 AM: git clone https://github.com/judepark/judepark.com
9:04:18 AM: Preparing Git Reference refs/heads/master
9:04:18 AM: Found netlify.toml. Overriding site configuration
9:04:18 AM: Different base path detected, going to use the one specified in the toml file: 'web/' versus '' in the site
9:04:18 AM: Starting build script
9:04:19 AM: Installing dependencies
9:04:20 AM: Downloading and installing node v10.17.0...
9:04:20 AM: Downloading https://nodejs.org/dist/v10.17.0/node-v10.17.0-linux-x64.tar.xz...
9:04:21 AM: 
##########
9:04:21 AM:                 15.1%
9:04:21 AM: 
#######################################################
9:04:21 AM: ################# 100.0%
9:04:21 AM: Computing checksum with sha256sum
9:04:21 AM: Checksums matched!
9:04:24 AM: Now using node v10.17.0 (npm v6.11.3)
9:04:24 AM: Attempting ruby version 2.6.2, read from environment
9:04:25 AM: Using ruby version 2.6.2
9:04:26 AM: Using PHP version 5.6
9:04:26 AM: Started restoring cached node modules
9:04:26 AM: Finished restoring cached node modules
9:04:26 AM: Installing NPM modules using NPM version 6.11.3
9:04:59 AM: > core-js@2.6.9 postinstall /opt/build/repo/web/node_modules/@babel/polyfill/node_modules/core-js
9:04:59 AM: > node scripts/postinstall || echo "ignore"
9:04:59 AM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
9:04:59 AM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
9:04:59 AM: > https://opencollective.com/core-js 
9:04:59 AM: > https://www.patreon.com/zloirock 
9:04:59 AM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
9:04:59 AM: > core-js@2.6.9 postinstall /opt/build/repo/web/node_modules/gatsby/node_modules/core-js
9:04:59 AM: > node scripts/postinstall || echo "ignore"
9:04:59 AM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
9:04:59 AM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
9:04:59 AM: > https://opencollective.com/core-js 
9:04:59 AM: > https://www.patreon.com/zloirock 
9:04:59 AM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
9:04:59 AM: > gatsby-telemetry@1.1.23 postinstall /opt/build/repo/web/node_modules/gatsby-telemetry
9:04:59 AM: > node src/postinstall.js
9:04:59 AM: > gatsby@2.15.16 postinstall /opt/build/repo/web/node_modules/gatsby
9:04:59 AM: > node scripts/postinstall.js
9:05:02 AM: npm
9:05:02 AM: WARN example-company-website-gatsby-sanity-combo-frontend@1.0.0 No description
9:05:02 AM: npm WARN example-company-website-gatsby-sanity-combo-frontend@1.0.0 No repository field.
9:05:02 AM: npm WARN example-company-website-gatsby-sanity-combo-frontend@1.0.0 No license field.
9:05:02 AM: npm
9:05:02 AM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
9:05:02 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
9:05:02 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/chokidar/node_modules/fsevents):
9:05:02 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
9:05:02 AM: added 1791 packages from 868 contributors and audited 21287 packages in 35.072s
9:05:02 AM: found 29 vulnerabilities (24 high, 5 critical)
9:05:02 AM:   run `npm audit fix` to fix them, or `npm audit` for details
9:05:02 AM: NPM modules installed
9:05:02 AM: Started restoring cached go cache
9:05:02 AM: Finished restoring cached go cache
9:05:02 AM: unset GOOS;
9:05:02 AM: unset GOARCH;
9:05:02 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
9:05:02 AM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
9:05:02 AM: go version >&2;
9:05:02 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
9:05:02 AM: go version go1.12 linux/amd64
9:05:02 AM: Installing missing commands
9:05:02 AM: Verify run directory
9:05:02 AM: Executing user command: npm run build
9:05:03 AM: > example-company-website-gatsby-sanity-combo-frontend@1.0.0 build /opt/build/repo/web
9:05:03 AM: > gatsby build
9:05:05 AM: success open and validate gatsby-configs — 0.030
9:05:06 AM: success load plugins — 0.456
9:05:06 AM: success onPreInit — 0.019
9:05:06 AM: success delete html and css files from previous builds — 0.026
9:05:06 AM: success initialize cache — 0.020
9:05:06 AM: success copy gatsby files — 0.052
9:05:06 AM: warning [sanity] `overlayDrafts` is set to `true`, but no token is given
9:05:06 AM: warning [sanity] Using `watchMode` when not in develop mode might prevent your build from completing
9:05:06 AM: info [sanity] Fetching remote GraphQL schema
9:05:06 AM: info [sanity] Transforming to Gatsby-compatible GraphQL SDL
9:05:07 AM: info [sanity] Stitching GraphQL schemas from SDL
9:05:07 AM: success onPreBootstrap — 0.376
9:05:07 AM: info [sanity] Fetching export stream for dataset
9:05:07 AM: info [sanity] Watch mode enabled, starting a listener
9:05:07 AM: info [sanity] Done exporting!
9:05:07 AM: success source and transform nodes — 0.290
9:05:07 AM: success Add explicit types — 0.040
9:05:07 AM: success Add inferred types — 0.080
9:05:07 AM: success Processing types — 0.218
9:05:07 AM: success building schema — 0.432
9:05:07 AM: success createPages — 0.039
9:05:07 AM: success createPagesStatefully — 0.110
9:05:07 AM: success onPreExtractQueries — 0.021
9:05:08 AM: success update schema — 0.044
9:05:08 AM: warning The GraphQL query in the non-page component "/opt/build/repo/web/src/templates/blog-post.js" will not be run.
9:05:08 AM: warning The GraphQL query in the non-page component "/opt/build/repo/web/src/templates/project.js" will not be run.
9:05:08 AM: Exported queries are only executed for Page components. It's possible you're
9:05:08 AM: trying to create pages in your gatsby-node.js and that's failing for some
9:05:08 AM: reason.
9:05:08 AM: If the failing component(s) is a regular component and not intended to be a page
9:05:08 AM: component, you generally want to use a <StaticQuery> (https://gatsbyjs.org/docs/static-query)
9:05:08 AM: instead of exporting a page query.
9:05:08 AM: If you're more experienced with GraphQL, you can also export GraphQL
9:05:08 AM: fragments from components and compose the fragments in the Page component
9:05:08 AM: query and pass data down into the child component — http://graphql.org/learn/queries/#fragments
9:05:08 AM: success extract queries from components — 0.525
9:05:08 AM: success write out requires — 0.024
9:05:08 AM: success write out redirect data — 0.020
9:05:08 AM: success onPostBootstrap — 0.016
9:05:08 AM: info bootstrap finished - 5.467 s
9:05:08 AM: success run static queries — 0.034 — 2/2 142.35 queries/second
9:05:30 AM: success Building production JavaScript and CSS bundles — 22.206
9:05:31 AM: success Rewriting compilation hashes — 0.039
9:05:31 AM: success run page queries — 0.157 — 7/7 85.85 queries/second
9:05:36 AM: success Building static HTML for pages — 5.005 — 7/7 28.32 pages/second
9:05:36 AM: info Done building in 33.127 sec
9:05:36 AM: Skipping functions preparation step: no functions directory set
9:05:36 AM: Caching artifacts
9:05:36 AM: Started saving node modules
9:05:36 AM: Finished saving node modules
9:05:36 AM: Started saving pip cache
9:05:36 AM: Finished saving pip cache
9:05:36 AM: Started saving emacs cask dependencies
9:05:36 AM: Finished saving emacs cask dependencies
9:05:36 AM: Started saving maven dependencies
9:05:36 AM: Finished saving maven dependencies
9:05:36 AM: Started saving boot dependencies
9:05:36 AM: Finished saving boot dependencies
9:05:36 AM: Started saving go dependencies
9:05:36 AM: Finished saving go dependencies
9:05:39 AM: Build script success
9:05:39 AM: Failing build: Failed to build site
9:05:39 AM: failed during stage 'building site': Deploy directory 'web/web/public' does not exist
9:05:39 AM: Finished processing build request in 1m22.727545616s

I expect it to build fine but it seems to have trouble with the deploy direction 'web/web/public", so I tried changing it in settings in Netlify. I tried all methods:

Base directory: web Publish directory: web/ public

or

Base directory: none Publish directory: web/public

or

Base directory: web Publish directory: public

Annotation 2019-11-19 091146

Can someone help me deploy my site to netlify?

ChristianLobaugh commented 4 years ago

Base Directory: Not set Publish directory: public

Everything else looks good. Try again using that