Deploy did not succeed: Deploy directory 'dist' does not exist. What is dist directory?

Deploy did not succeed: Deploy directory ‘dist’ does not exist
What is this dist directory? How can I solve this?

github repo: GitHub - HigorR456/Task-App: This is a to do list, this app has add and remove task option, in the futere I'll add edit task button, auto sort per start time,, theme switcher and o ther features.

8:09:36 PM: build-image version: 5e2052dbf11f1636a7bac1839aff8991d186d620 (focal)
8:09:36 PM: buildbot version: 5e2052dbf11f1636a7bac1839aff8991d186d620
8:09:36 PM: Fetching cached dependencies
8:09:36 PM: Starting to download cache of 88.2MB
8:09:37 PM: Finished downloading cache in 1.012s
8:09:37 PM: Starting to extract cache
8:09:37 PM: Finished extracting cache in 632ms
8:09:37 PM: Finished fetching cache in 1.693s
8:09:37 PM: Starting to prepare the repo for build
8:09:38 PM: Preparing Git Reference refs/heads/main
8:09:38 PM: Parsing package.json dependencies
8:09:39 PM: Starting to install dependencies
8:09:39 PM: Python version set to 3.8
8:09:39 PM: Started restoring cached go cache
8:09:39 PM: Finished restoring cached go cache
8:09:39 PM: Installing Go version 1.19.5 (requested 1.19.5)
8:09:45 PM: go version go1.19.5 linux/amd64
8:09:45 PM: Using PHP version 8.0
8:09:45 PM: Started restoring cached Node.js version
8:09:46 PM: Finished restoring cached Node.js version
8:09:46 PM: v16.19.1 is already installed.
8:09:46 PM: Now using node v16.19.1 (npm v8.19.3)
8:09:46 PM: Enabling Node.js Corepack
8:09:46 PM: Started restoring cached build plugins
8:09:46 PM: Finished restoring cached build plugins
8:09:46 PM: Started restoring cached corepack dependencies
8:09:46 PM: Finished restoring cached corepack dependencies
8:09:46 PM: No npm workspaces detected
8:09:46 PM: Started restoring cached node modules
8:09:46 PM: Finished restoring cached node modules
8:09:47 PM: Installing npm packages using npm version 8.19.3
8:09:55 PM: added 167 packages, removed 84 packages, changed 16 packages, and audited 211 packages in 8s
8:09:55 PM: 35 packages are looking for funding
8:09:55 PM:   run `npm fund` for details
8:09:55 PM: found 0 vulnerabilities
8:09:55 PM: npm packages installed
8:09:55 PM: Attempting Ruby version 2.7.2, read from environment
8:09:56 PM: Using Ruby version 2.7.2
8:09:58 PM: Install dependencies script success
8:09:58 PM: Starting build script
8:09:58 PM: Using stage install dependencies
8:09:58 PM: Detected 1 framework(s)
8:09:58 PM: "next" at version "13.2.4"
8:09:58 PM: Section completed: initializing
8:10:00 PM: ​
8:10:00 PM:   Netlify Build                                                 
8:10:00 PM: ────────────────────────────────────────────────────────────────
8:10:00 PM: ​
8:10:00 PM: ❯ Version
8:10:00 PM:   @netlify/build 29.7.1
8:10:00 PM: ​
8:10:00 PM: ❯ Flags
8:10:00 PM:   baseRelDir: true
8:10:00 PM:   buildId: 6422222d6c754400081b4069
8:10:00 PM:   deployId: 6422222d6c754400081b406b
8:10:00 PM: ​
8:10:00 PM: ❯ Current directory
8:10:00 PM:   /opt/build/repo
8:10:00 PM: ​
8:10:00 PM: ❯ Config file
8:10:00 PM:   No config file was defined: using default values.
8:10:00 PM: ​
8:10:00 PM: ❯ Context
8:10:00 PM:   production
8:10:00 PM: ​
8:10:00 PM:   1. Build command from Netlify app                             
8:10:00 PM: ────────────────────────────────────────────────────────────────
8:10:00 PM: ​
8:10:00 PM: $ npm run build
8:10:00 PM: > task-app@0.1.0 build
8:10:00 PM: > next build
8:10:00 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
8:10:00 PM: info  - Linting and checking validity of types...
8:10:02 PM: info  - Creating an optimized production build...
8:10:05 PM: info  - Compiled successfully
8:10:05 PM: info  - Collecting page data...
8:10:10 PM: info  - Generating static pages (0/3)
8:10:10 PM: info  - Generating static pages (3/3)
8:10:11 PM: info  - Finalizing page optimization...
8:10:11 PM: Route (pages)                              Size     First Load JS
8:10:11 PM: ┌ ○ /                                      3.76 kB          77 kB
8:10:11 PM: ├   /_app                                  0 B            73.3 kB
8:10:11 PM: ├ ○ /404                                   182 B          73.4 kB
8:10:11 PM: └ λ /api/hello                             0 B            73.3 kB
8:10:11 PM: + First Load JS shared by all              74.2 kB
8:10:11 PM:   ├ chunks/framework-2c79e2a64abdb08b.js   45.2 kB
8:10:11 PM:   ├ chunks/main-7477d36a73a3487c.js        27 kB
8:10:11 PM:   ├ chunks/pages/_app-cb4d59606a29a817.js  296 B
8:10:11 PM:   ├ chunks/webpack-8fa1640cc84ba8fe.js     750 B
8:10:11 PM:   └ css/e956ab2bf8369065.css               908 B
8:10:11 PM: λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
8:10:11 PM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
8:10:11 PM: ​
8:10:11 PM: (build.command completed in 11.1s)
8:10:11 PM: ​
8:10:11 PM:   2. Deploy site                                                
8:10:11 PM: ────────────────────────────────────────────────────────────────
8:10:11 PM: ​
8:10:11 PM: Section completed: deploying
8:10:11 PM: ​
8:10:11 PM:   Configuration error                                           
8:10:11 PM: ────────────────────────────────────────────────────────────────
8:10:11 PM: ​
8:10:11 PM:   Error message
8:10:11 PM:   Deploy did not succeed: Deploy directory 'dist' does not exist
8:10:11 PM: ​
8:10:11 PM:   Resolved config
8:10:11 PM:   build:
8:10:11 PM:     command: npm run build
8:10:11 PM:     commandOrigin: ui
8:10:11 PM:     publish: /opt/build/repo/dist
8:10:11 PM:     publishOrigin: ui
8:10:11 PM: Caching artifacts
8:10:12 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
8:10:11 PM: Started saving node modules
8:10:11 PM: Finished saving node modules
8:10:11 PM: Started saving build plugins
8:10:11 PM: Finished saving build plugins
8:10:11 PM: Started saving corepack cache
8:10:11 PM: Finished saving corepack cache
8:10:11 PM: Started saving pip cache
8:10:11 PM: Finished saving pip cache
8:10:11 PM: Started saving emacs cask dependencies
8:10:11 PM: Finished saving emacs cask dependencies
8:10:11 PM: Started saving maven dependencies
8:10:11 PM: Finished saving maven dependencies
8:10:11 PM: Started saving boot dependencies
8:10:11 PM: Finished saving boot dependencies
8:10:11 PM: Started saving rust rustup cache
8:10:11 PM: Finished saving rust rustup cache
8:10:11 PM: Started saving go dependencies
8:10:11 PM: Finished saving go dependencies
8:10:12 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:10:12 PM: Failing build: Failed to build site
8:10:12 PM: Finished processing build request in 36.797s

Have you looked at the Netlify Next.js documentation to check the project configuration is correct

Here:

and here:

Hi @HigorR456 :wave:t6: ,

Could you post a screenshot of your build settings and also your package.json please

hi sam, I solved the deploy directory ‘dist’ error by changing it to ‘.next’ but now my page has ‘page not found’ error, you can see it here: https://task-app456.netlify.app/
you can see package.json here: Task-App/package.json at main · HigorR456/Task-App · GitHub

The site appears to load correctly for me @HigorR456 so I assume you tracked down the issue?