Turborepo + SvelteKit deployment build directory not found error

I’m trying to deploy the official Turborepo + SvelteKit boilerplate from Vercel, found here, their repo here

Error Excerpt

3:35:37 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:35:37 PM: Failing build: Failed to build site
3:35:37 PM: Finished processing build request in 26.034s

…Deploy directory ‘build’ does not exist

Context

  • I’ve added netlify.toml pages to /web and /docs
  • My repo source code is here
  • My Netlify site name is svelte-turbo-ex-deployme
  • I read that the build command can give strange errors if it’s used. I’ve tried to rename the build command to buildme, but I got the same error either way.
  • I’ve downloaded netlify-cli locally and tested running netlify build locally. The apps/web/build and apps/docs/build directory are created correctly.
  • I’ve tried to change publish = "apps/docs/build" and publish = "apps/web/build" in the respective netlify.toml files, but got the same error

Logs

3:35:11 PM: build-image version: 73f16e520fdddf409be6f578c8c2c8941bdf32d3 (focal)
3:35:11 PM: buildbot version: a11acbb405af91d225b392f15bc00822dbffb366
3:35:11 PM: Fetching cached dependencies
3:35:11 PM: Failed to fetch cache, continuing with build
3:35:11 PM: Starting to prepare the repo for build
3:35:11 PM: No cached dependencies found. Cloning fresh repo
3:35:11 PM: git clone --filter=blob:none https://github.com/thebrianbug/svelte-turbo
3:35:11 PM: Preparing Git Reference refs/heads/main
3:35:13 PM: Starting to install dependencies
3:35:13 PM: Python version set to 3.8
3:35:13 PM: Attempting Ruby version 2.7.2, read from environment
3:35:14 PM: Using Ruby version 2.7.2
3:35:14 PM: Started restoring cached go cache
3:35:14 PM: Finished restoring cached go cache
3:35:15 PM: Installing Go version 1.19.13 (requested 1.19.x)
3:35:22 PM: go version go1.19.13 linux/amd64
3:35:22 PM: Using PHP version 8.0
3:35:23 PM: v18.17.1 is already installed.
3:35:23 PM: Now using node v18.17.1 (npm v9.6.7)
3:35:23 PM: Enabling Node.js Corepack
3:35:23 PM: Started restoring cached build plugins
3:35:23 PM: Finished restoring cached build plugins
3:35:23 PM: Started restoring cached corepack dependencies
3:35:23 PM: Finished restoring cached corepack dependencies
3:35:23 PM: npm workspaces detected
3:35:24 PM: Installing npm packages using npm version 9.6.7
3:35:25 PM: npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
3:35:25 PM: npm WARN deprecated @types/sass@1.45.0: This is a stub types definition. sass provides its own type definitions, so you do not need this installed.
3:35:27 PM: added 211 packages, and audited 216 packages in 3s
3:35:27 PM: 39 packages are looking for funding
3:35:27 PM:   run `npm fund` for details
3:35:27 PM: found 0 vulnerabilities
3:35:27 PM: npm packages installed
3:35:28 PM: Install dependencies script success
3:35:28 PM: Starting build script
3:35:28 PM: Detected 0 framework(s)
3:35:28 PM: Section completed: initializing
3:35:30 PM: ​
3:35:30 PM: Netlify Build                                                 
3:35:30 PM: ────────────────────────────────────────────────────────────────
3:35:30 PM: ​
3:35:30 PM: ❯ Version
3:35:30 PM:   @netlify/build 29.20.12
3:35:30 PM: ​
3:35:30 PM: ❯ Flags
3:35:30 PM:   baseRelDir: true
3:35:30 PM:   buildId: 65037c8d5e219f00089a23c0
3:35:30 PM:   deployId: 65037c8d5e219f00089a23c2
3:35:30 PM:   packagePath: apps/web
3:35:30 PM: ​
3:35:30 PM: ❯ Current directory
3:35:30 PM:   /opt/build/repo
3:35:30 PM: ​
3:35:30 PM: ❯ Config file
3:35:30 PM:   /opt/build/repo/apps/web/netlify.toml
3:35:30 PM: ​
3:35:30 PM: ❯ Context
3:35:30 PM:   production
3:35:30 PM: ​
3:35:30 PM: build.command from netlify.toml                               
3:35:30 PM: ────────────────────────────────────────────────────────────────
3:35:30 PM: ​
3:35:30 PM: $ npm run check && npm run build
3:35:30 PM: > check
3:35:30 PM: > turbo run check
3:35:30 PM: • Packages in scope: docs, eslint-config-custom, ui, web
3:35:30 PM: • Running check in 4 packages
3:35:30 PM: • Remote caching disabled
3:35:30 PM: docs:check: cache miss, executing 0c41624f937800c9
3:35:30 PM: web:check: cache miss, executing bb8f528ff6919a43
3:35:30 PM: docs:check: 
3:35:30 PM: docs:check: > docs@0.0.0 check
3:35:30 PM: docs:check: > svelte-check --tsconfig ./tsconfig.json
3:35:30 PM: docs:check: 
3:35:30 PM: web:check: 
3:35:30 PM: web:check: > web@0.0.0 check
3:35:30 PM: web:check: > svelte-check --tsconfig ./tsconfig.json
3:35:30 PM: web:check: 
3:35:31 PM: web:check: 
3:35:31 PM: web:check: ====================================
3:35:31 PM: web:check: Loading svelte-check in workspace: /opt/build/repo/apps/web
3:35:31 PM: web:check: Getting Svelte diagnostics...
3:35:31 PM: web:check: 
3:35:31 PM: docs:check: 
3:35:31 PM: docs:check: ====================================
3:35:31 PM: docs:check: Loading svelte-check in workspace: /opt/build/repo/apps/docs
3:35:31 PM: docs:check: Getting Svelte diagnostics...
3:35:31 PM: docs:check: 
3:35:32 PM: web:check: ====================================
3:35:32 PM: web:check: svelte-check found 0 errors, 0 warnings, and 0 hints
3:35:32 PM: web:check: 
3:35:32 PM: docs:check: ====================================
3:35:32 PM: docs:check: svelte-check found 0 errors, 0 warnings, and 0 hints
3:35:32 PM: docs:check: 
3:35:32 PM:  Tasks:    2 successful, 2 total
3:35:32 PM: Cached:    0 cached, 2 total
3:35:32 PM:   Time:    1.887s
3:35:32 PM: > build
3:35:32 PM: > turbo run build
3:35:32 PM: • Packages in scope: docs, eslint-config-custom, ui, web
3:35:32 PM: • Running build in 4 packages
3:35:32 PM: • Remote caching disabled
3:35:32 PM: docs:build: cache miss, executing 03244739048ba980
3:35:32 PM: web:build: cache miss, executing bfbff4f5be7cc228
3:35:32 PM: docs:build: 
3:35:32 PM: docs:build: > docs@0.0.0 build
3:35:32 PM: docs:build: > vite build
3:35:32 PM: docs:build: 
3:35:32 PM: web:build: 
3:35:32 PM: web:build: > web@0.0.0 build
3:35:32 PM: web:build: > vite build
3:35:32 PM: web:build: 
3:35:33 PM: web:build: 
3:35:33 PM: web:build: vite v4.4.9 building SSR bundle for production...
3:35:33 PM: docs:build: 
3:35:33 PM: docs:build: vite v4.4.9 building SSR bundle for production...
3:35:33 PM: web:build: transforming...
3:35:33 PM: docs:build: transforming...
3:35:34 PM: web:build: ✓ 53 modules transformed.
3:35:34 PM: docs:build: ✓ 53 modules transformed.
3:35:34 PM: web:build: rendering chunks...
3:35:34 PM: docs:build: rendering chunks...
3:35:34 PM: web:build: 
3:35:34 PM: web:build: vite v4.4.9 building for production...
3:35:34 PM: web:build: transforming...
3:35:34 PM: docs:build: 
3:35:34 PM: docs:build: vite v4.4.9 building for production...
3:35:34 PM: docs:build: transforming...
3:35:34 PM: web:build: ✓ 42 modules transformed.
3:35:34 PM: docs:build: ✓ 42 modules transformed.
3:35:34 PM: web:build: rendering chunks...
3:35:34 PM: docs:build: rendering chunks...
3:35:34 PM: docs:build: computing gzip size...
3:35:34 PM: web:build: computing gzip size...
3:35:34 PM: docs:build: .svelte-kit/output/client/_app/version.json                              0.03 kB │ gzip: 0.05 kB
3:35:34 PM: docs:build: .svelte-kit/output/client/vite-manifest.json                             1.85 kB │ gzip: 0.37 kB
3:35:34 PM: docs:build: .svelte-kit/output/client/_app/immutable/nodes/0.0d30871a.js             0.55 kB │ gzip: 0.37 kB
3:35:34 PM: docs:build: .svelte-kit/output/client/_app/immutable/nodes/1.f67b4ccb.js             0.98 kB │ gzip: 0.57 kB
3:35:34 PM: docs:build: .svelte-kit/output/client/_app/immutable/nodes/2.df00dbae.js             1.41 kB │ gzip: 0.74 kB
3:35:34 PM: docs:build: .svelte-kit/output/client/_app/immutable/chunks/singletons.074f1319.js   2.85 kB │ gzip: 1.46 kB
3:35:34 PM: docs:build: .svelte-kit/output/client/_app/immutable/entry/app.fba91eec.js           5.65 kB │ gzip: 2.27 kB
3:35:34 PM: docs:build: .svelte-kit/output/client/_app/immutable/chunks/index.20fe1016.js        7.15 kB │ gzip: 2.89 kB
3:35:34 PM: docs:build: .svelte-kit/output/client/_app/immutable/entry/start.01093f70.js        24.82 kB │ gzip: 9.78 kB
3:35:34 PM: web:build: .svelte-kit/output/client/_app/version.json                              0.03 kB │ gzip: 0.05 kB
3:35:34 PM: docs:build: ✓ built in 435ms
3:35:34 PM: web:build: .svelte-kit/output/client/vite-manifest.json                             1.85 kB │ gzip: 0.37 kB
3:35:34 PM: web:build: .svelte-kit/output/client/_app/immutable/nodes/0.0d30871a.js             0.55 kB │ gzip: 0.37 kB
3:35:34 PM: web:build: .svelte-kit/output/client/_app/immutable/nodes/1.95ca57c8.js             0.98 kB │ gzip: 0.57 kB
3:35:34 PM: web:build: .svelte-kit/output/client/_app/immutable/nodes/2.d418a360.js             1.41 kB │ gzip: 0.74 kB
3:35:34 PM: web:build: .svelte-kit/output/client/_app/immutable/chunks/singletons.e88881af.js   2.85 kB │ gzip: 1.46 kB
3:35:34 PM: web:build: .svelte-kit/output/client/_app/immutable/entry/app.137f8785.js           5.65 kB │ gzip: 2.27 kB
3:35:34 PM: web:build: .svelte-kit/output/client/_app/immutable/chunks/index.20fe1016.js        7.15 kB │ gzip: 2.89 kB
3:35:34 PM: web:build: .svelte-kit/output/client/_app/immutable/entry/start.adae03ed.js        24.82 kB │ gzip: 9.78 kB
3:35:34 PM: web:build: ✓ built in 448ms
3:35:34 PM: web:build: .svelte-kit/output/server/vite-manifest.json                   1.34 kB
3:35:34 PM: web:build: .svelte-kit/output/server/internal.js                          0.19 kB
3:35:34 PM: web:build: .svelte-kit/output/server/entries/fallbacks/layout.svelte.js   0.24 kB
3:35:34 PM: web:build: .svelte-kit/output/server/entries/pages/_page.svelte.js        0.59 kB
3:35:34 PM: web:build: .svelte-kit/output/server/entries/fallbacks/error.svelte.js    0.89 kB
3:35:34 PM: web:build: .svelte-kit/output/server/chunks/index.js                      3.27 kB
3:35:34 PM: web:build: .svelte-kit/output/server/chunks/internal.js                   5.37 kB
3:35:34 PM: web:build: .svelte-kit/output/server/index.js                            89.51 kB
3:35:34 PM: web:build: 
3:35:34 PM: web:build: Run npm run preview to preview your production build locally.
3:35:34 PM: web:build: 
3:35:34 PM: web:build: > Using @sveltejs/adapter-netlify
3:35:34 PM: web:build:   ✔ done
3:35:34 PM: web:build: ✓ built in 1.35s
3:35:34 PM: docs:build: .svelte-kit/output/server/vite-manifest.json                   1.34 kB
3:35:34 PM: docs:build: .svelte-kit/output/server/internal.js                          0.19 kB
3:35:34 PM: docs:build: .svelte-kit/output/server/entries/fallbacks/layout.svelte.js   0.24 kB
3:35:34 PM: docs:build: .svelte-kit/output/server/entries/pages/_page.svelte.js        0.59 kB
3:35:34 PM: docs:build: .svelte-kit/output/server/entries/fallbacks/error.svelte.js    0.89 kB
3:35:34 PM: docs:build: .svelte-kit/output/server/chunks/index.js                      3.27 kB
3:35:34 PM: docs:build: .svelte-kit/output/server/chunks/internal.js                   5.37 kB
3:35:34 PM: docs:build: .svelte-kit/output/server/index.js                            89.51 kB
3:35:34 PM: docs:build: 
3:35:34 PM: docs:build: Run npm run preview to preview your production build locally.
3:35:34 PM: docs:build: 
3:35:34 PM: docs:build: > Using @sveltejs/adapter-netlify
3:35:35 PM: docs:build:   ✔ done
3:35:35 PM: docs:build: ✓ built in 1.36s
3:35:35 PM:  Tasks:    2 successful, 2 total
3:35:35 PM: Cached:    0 cached, 2 total
3:35:35 PM:   Time:    2.315s
3:35:35 PM: ​
3:35:35 PM: (build.command completed in 4.7s)
3:35:35 PM: ​
3:35:35 PM: Functions bundling                                            
3:35:35 PM: ────────────────────────────────────────────────────────────────
3:35:35 PM: ​
3:35:35 PM: Packaging Functions from apps/web/.netlify/functions-internal directory:
3:35:35 PM:  - sveltekit-render.mjs
3:35:35 PM: ​
3:35:35 PM: ​
3:35:35 PM: (Functions bundling completed in 522ms)
3:35:35 PM: ​
3:35:35 PM: Deploy site                                                   
3:35:35 PM: ────────────────────────────────────────────────────────────────
3:35:35 PM: ​
3:35:35 PM: Section completed: deploying
3:35:35 PM: ​
3:35:35 PM: Configuration error                                           
3:35:35 PM: ────────────────────────────────────────────────────────────────
3:35:35 PM: ​
3:35:35 PM:   Error message
3:35:35 PM:   Deploy did not succeed: Deploy directory 'build' does not exist
3:35:35 PM: ​
3:35:35 PM:   Resolved config
3:35:35 PM:   build:
3:35:35 PM:     command: npm run check && npm run build
3:35:35 PM:     commandOrigin: config
3:35:35 PM:     publish: /opt/build/repo/build
3:35:35 PM:     publishOrigin: config
3:35:36 PM: Caching artifacts
3:35:36 PM: Started saving workspace root node modules
3:35:36 PM: Finished saving workspace root node modules
3:35:36 PM: Started saving build plugins
3:35:36 PM: Finished saving build plugins
3:35:36 PM: Started saving corepack cache
3:35:36 PM: Finished saving corepack cache
3:35:36 PM: Started saving pip cache
3:35:36 PM: Finished saving pip cache
3:35:36 PM: Started saving emacs cask dependencies
3:35:36 PM: Finished saving emacs cask dependencies
3:35:36 PM: Started saving maven dependencies
3:35:36 PM: Finished saving maven dependencies
3:35:36 PM: Started saving boot dependencies
3:35:36 PM: Finished saving boot dependencies
3:35:36 PM: Started saving rust rustup cache
3:35:36 PM: Finished saving rust rustup cache
3:35:36 PM: Started saving go dependencies
3:35:36 PM: Finished saving go dependencies
3:35:37 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:35:37 PM: Failing build: Failed to build site
3:35:37 PM: Finished processing build request in 26.034s

Build settings

Could you share a link to the deploys of these attempts?