Deploy directory 'build' does not exist on Nextjs 13

This is my first try to publish here nextjs13. Before I was using nextjs 12 and everything always worked. Now I always get Deploy directory 'build' does not exist no matter what I do… Using the same parameters from nextjs 12 is not working.

What I tried:

  1. Adding command to netlify.toml
[build]	
    command = "npm run build && npm run export"
    build = "build"
  1. Adding distDir: "build" to next.config.js
  2. Adding .next to the “Base directory” in the netify “Build settings”.
  3. npm install -D @netlify/plugin-nextjs@appdir after checking tips from Deploy Next.js 13 on Netlify Today

URL https://marvelous-bombolone-0abe18.netlify.app/

Error:

3:24:15 PM: build-image version: f16fe5e1d2fb705a244177206285638af584a46c (focal)
3:24:15 PM: buildbot version: f16fe5e1d2fb705a244177206285638af584a46c
3:24:16 PM: Fetching cached dependencies
3:24:16 PM: Starting to download cache of 147.8MB
3:24:16 PM: Finished downloading cache in 564ms
3:24:16 PM: Starting to extract cache
3:24:18 PM: Finished extracting cache in 1.399s
3:24:18 PM: Finished fetching cache in 2.018s
3:24:18 PM: Starting to prepare the repo for build
3:24:18 PM: Preparing Git Reference refs/heads/main
3:24:19 PM: Parsing package.json dependencies
3:24:20 PM: Starting build script
3:24:20 PM: Installing dependencies
3:24:20 PM: Python version set to 2.7
3:24:20 PM: Started restoring cached Node.js version
3:24:21 PM: Finished restoring cached Node.js version
3:24:21 PM: v16.19.1 is already installed.
3:24:22 PM: Now using node v16.19.1 (npm v8.19.3)
3:24:22 PM: Enabling Node.js Corepack
3:24:22 PM: Started restoring cached build plugins
3:24:22 PM: Finished restoring cached build plugins
3:24:22 PM: Attempting Ruby version 2.7.2, read from environment
3:24:23 PM: Using Ruby version 2.7.2
3:24:23 PM: Using PHP version 8.0
3:24:23 PM: Started restoring cached corepack dependencies
3:24:23 PM: Finished restoring cached corepack dependencies
3:24:23 PM: No npm workspaces detected
3:24:23 PM: Started restoring cached node modules
3:24:23 PM: Finished restoring cached node modules
3:24:23 PM: Installing npm packages using npm version 8.19.3
3:24:27 PM: added 122 packages, and audited 432 packages in 4s
3:24:27 PM: 134 packages are looking for funding
3:24:27 PM:   run `npm fund` for details
3:24:27 PM: found 0 vulnerabilities
3:24:27 PM: npm packages installed
3:24:28 PM: Started restoring cached go cache
3:24:28 PM: Finished restoring cached go cache
3:24:28 PM: go version go1.19.7 linux/amd64
3:24:28 PM: Detected 1 framework(s)
3:24:28 PM: "next" at version "13.2.4"
3:24:28 PM: Section completed: initializing
3:24:29 PM: ​
3:24:29 PM:   Netlify Build                                                 
3:24:29 PM: ────────────────────────────────────────────────────────────────
3:24:29 PM: ​
3:24:29 PM: ❯ Version
3:24:29 PM:   @netlify/build 29.7.1
3:24:29 PM: ​
3:24:29 PM: ❯ Flags
3:24:29 PM:   baseRelDir: true
3:24:29 PM:   buildId: 641c52fc1d9dde06b0f04043
3:24:29 PM:   deployId: 641c52fc1d9dde06b0f04045
3:24:29 PM: ​
3:24:29 PM: ❯ Current directory
3:24:29 PM:   /opt/build/repo
3:24:29 PM: ​
3:24:29 PM: ❯ Config file
3:24:29 PM:   /opt/build/repo/netlify.toml
3:24:29 PM: ​
3:24:29 PM: ❯ Context
3:24:29 PM:   production
3:24:29 PM: ​
3:24:29 PM:   1. Build command from Netlify app                             
3:24:29 PM: ────────────────────────────────────────────────────────────────
3:24:29 PM: ​
3:24:29 PM: $ npm run build
3:24:30 PM: > learn_lithuanian@0.1.0 build
3:24:30 PM: > next build
3:24:30 PM: warn  - You have enabled experimental feature (appDir) in next.config.js.
3:24:30 PM: warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
3:24:30 PM: info  - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback
3:24:30 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
3:24:30 PM: info  - Creating an optimized production build...
3:24:35 PM: info  - Compiled successfully
3:24:35 PM: info  - Linting and checking validity of types...
3:24:37 PM: Pages directory cannot be found at /opt/build/repo/pages or /opt/build/repo/src/pages. If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.
3:24:37 PM: info  - Collecting page data...
3:24:43 PM: info  - Generating static pages (0/5)
3:24:43 PM: info  - Generating static pages (1/5)
3:24:43 PM: info  - Generating static pages (2/5)
3:24:43 PM: info  - Generating static pages (3/5)
3:24:43 PM: info  - Generating static pages (5/5)
3:24:44 PM: info  - Finalizing page optimization...
3:24:44 PM: Route (app)                                Size     First Load JS
3:24:44 PM: ┌ ○ /                                      172 B          74.5 kB
3:24:44 PM: ├ ○ /api/hello                             0 B                0 B
3:24:44 PM: └ ○ /learn                                 2.2 kB         76.5 kB
3:24:44 PM: + First Load JS shared by all              68.8 kB
3:24:44 PM:   ├ chunks/455-dd12041dc6de680b.js         66.4 kB
3:24:44 PM:   ├ chunks/main-app-b08d576ce513f540.js    203 B
3:24:44 PM:   └ chunks/webpack-596cea53c54d0255.js     2.22 kB
3:24:44 PM: Route (pages)                              Size     First Load JS
3:24:44 PM: ─ ○ /404                                   179 B          84.7 kB
3:24:44 PM: + First Load JS shared by all              84.5 kB
3:24:44 PM:   ├ chunks/main-6548d0ced9f53da0.js        82.1 kB
3:24:44 PM:   ├ chunks/pages/_app-907dedfd0e4177db.js  192 B
3:24:44 PM:   └ chunks/webpack-596cea53c54d0255.js     2.22 kB
3:24:44 PM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
3:24:44 PM: ​
3:24:44 PM: (build.command completed in 14.4s)
3:24:44 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
3:24:44 PM: ​
3:24:44 PM:   2. Deploy site                                                
3:24:44 PM: ────────────────────────────────────────────────────────────────
3:24:44 PM: ​
3:24:44 PM: Section completed: deploying
3:24:44 PM: ​
3:24:44 PM:   Configuration error                                           
3:24:44 PM: ────────────────────────────────────────────────────────────────
3:24:44 PM: ​
3:24:44 PM:   Error message
3:24:44 PM:   Deploy did not succeed: Deploy directory 'build' does not exist
3:24:44 PM: ​
3:24:44 PM:   Resolved config
3:24:44 PM:   build:
3:24:44 PM:     command: npm run build
3:24:44 PM:     commandOrigin: ui
3:24:44 PM:     publish: /opt/build/repo/build
3:24:44 PM:     publishOrigin: ui
3:24:44 PM: Caching artifacts
3:24:44 PM: Started saving node modules
3:24:44 PM: Finished saving node modules
3:24:44 PM: Started saving build plugins
3:24:44 PM: Finished saving build plugins
3:24:44 PM: Started saving corepack cache
3:24:44 PM: Finished saving corepack cache
3:24:44 PM: Started saving pip cache
3:24:44 PM: Finished saving pip cache
3:24:44 PM: Started saving emacs cask dependencies
3:24:44 PM: Finished saving emacs cask dependencies
3:24:44 PM: Started saving maven dependencies
3:24:44 PM: Finished saving maven dependencies
3:24:44 PM: Started saving boot dependencies
3:24:44 PM: Finished saving boot dependencies
3:24:44 PM: Started saving rust rustup cache
3:24:44 PM: Finished saving rust rustup cache
3:24:44 PM: Started saving go dependencies
3:24:44 PM: Finished saving go dependencies
3:24:44 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:24:44 PM: Failing build: Failed to build site
3:24:45 PM: Finished processing build request in 29.077s

My package.json

{
  "name": "learn_lithuanian",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "eslint": "8.36.0",
    "eslint-config-next": "13.2.4",
    "next": "13.2.4",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "sass": "^1.59.3"
  },
  "devDependencies": {
    "@netlify/plugin-nextjs": "^4.29.5-appdir.0",
    "autoprefixer": "^10.4.14",
    "postcss": "^8.4.21",
    "tailwindcss": "^3.2.7"
  }
}

Build settings:

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

@SamO

Thanks for the reply. I checked and not helping… I added what you asked in the main post. I tried everything I could find on the forum and site. I only have an issue on nextjs13… On nextjs 12 all worked for me and working for other projects I have…

Hi @alexts9565 ,

Thanks for the follow-up.

Could you change the publish directory in the Build settings from build to .next.

Also we see in the deploy log, that the Netlify Next.js Runtime is missing. Please install by following the manual installation from the Readme.md under Manually installing the Next.js Runtime:

Let us know if you have any questions.

Thanks @Melvin. Old error gone but now new error Internal error during "Edge Functions bundling" .

The log is too large for one post so I will split it.

Part 1

5:32:11 PM: build-image version: f16fe5e1d2fb705a244177206285638af584a46c (focal)
5:32:11 PM: buildbot version: f16fe5e1d2fb705a244177206285638af584a46c
5:32:11 PM: Building without cache
5:32:11 PM: Starting to prepare the repo for build
5:32:11 PM: No cached dependencies found. Cloning fresh repo
5:32:11 PM: git clone --filter=blob:none https://github.com/alextseitlin/learnLithuanian
5:32:12 PM: Preparing Git Reference refs/heads/main
5:32:13 PM: Parsing package.json dependencies
5:32:14 PM: 
​
❯ Initial build environment
baseRelDir: true
branch: main
context: production
cwd: /opt/build/repo
featureFlags: []
mode: buildbot
repositoryRoot: /opt/build/repo
siteId: 5d259ff1-6089-4b86-9c08-e99b069f8aab
​
❯ UI build settings
baseRelDir: true
build:
  command: npm run build
  environment:
    - NETLIFY_BUILD_DEBUG
  publish: .next
​
❯ Resolved build environment
branch: main
buildDir: /opt/build/repo
configPath: /opt/build/repo/netlify.toml
context: production
env: []
​
❯ Resolved config
build:
  command: npm run build
  commandOrigin: ui
  environment:
    - NETLIFY_BUILD_DEBUG
  publish: /opt/build/repo/.next
  publishOrigin: ui
plugins:
  - inputs: {}
    origin: config
    package: '@netlify/plugin-nextjs'

5:32:14 PM: Starting build script
5:32:14 PM: Installing dependencies
5:32:14 PM: Python version set to 2.7
5:32:14 PM: v16.19.1 is already installed.
5:32:15 PM: Now using node v16.19.1 (npm v8.19.3)
5:32:15 PM: Enabling Node.js Corepack
5:32:15 PM: Started restoring cached build plugins
5:32:15 PM: Finished restoring cached build plugins
5:32:15 PM: Attempting Ruby version 2.7.2, read from environment
5:32:15 PM: Using Ruby version 2.7.2
5:32:16 PM: Using PHP version 8.0
5:32:16 PM: Started restoring cached corepack dependencies
5:32:16 PM: Finished restoring cached corepack dependencies
5:32:16 PM: No npm workspaces detected
5:32:16 PM: Started restoring cached node modules
5:32:16 PM: Finished restoring cached node modules
5:32:16 PM: Installing npm packages using npm version 8.19.3
5:32:23 PM: added 431 packages, and audited 432 packages in 7s
5:32:23 PM: 134 packages are looking for funding
5:32:23 PM:   run `npm fund` for details
5:32:23 PM: found 0 vulnerabilities
5:32:23 PM: npm packages installed
5:32:23 PM: Started restoring cached go cache
5:32:23 PM: Finished restoring cached go cache
5:32:23 PM: go version go1.19.7 linux/amd64
5:32:24 PM: Detected 1 framework(s)
5:32:24 PM: "next" at version "13.2.4"
5:32:24 PM: Section completed: initializing
5:32:25 PM: ​
5:32:25 PM:   Netlify Build                                                 
5:32:25 PM: ────────────────────────────────────────────────────────────────
5:32:25 PM: ​
5:32:25 PM: ❯ Version
5:32:25 PM:   @netlify/build 29.7.1
5:32:25 PM: ​
5:32:25 PM: ❯ Flags
5:32:25 PM:   apiHost: api.netlify.com
5:32:25 PM:   baseRelDir: true
5:32:25 PM:   branch: main
5:32:25 PM:   buildId: 641c70f82d919d005ab59b21
5:32:25 PM:   buildbotServerSocket: /tmp/netlify-buildbot-socket
5:32:25 PM:   cacheDir: /opt/build/cache
5:32:25 PM:   cachedConfigPath: /tmp/netlify_config.json
5:32:25 PM:   context: production
5:32:25 PM:   cwd: /opt/build/repo
5:32:25 PM:   deployId: 641c70f82d919d005ab59b23
5:32:25 PM:   edgeFunctionsDistDir: /tmp/edge-641c70f82d919d005ab59b23
5:32:25 PM:   featureFlags:
5:32:25 PM:     - edge_functions_cache_cli
5:32:25 PM:     - edge_functions_system_logger
5:32:25 PM:   framework: next
5:32:25 PM:   functionsDistDir: /tmp/zisi-641c70f82d919d005ab59b23
5:32:25 PM:   mode: buildbot
5:32:25 PM:   nodePath: /opt/buildhome/.nvm/versions/node/v16.19.1/bin/node
5:32:25 PM:   repositoryRoot: /opt/build/repo
5:32:25 PM:   saveConfig: true
5:32:25 PM:   sendStatus: true
5:32:25 PM:   siteId: 5d259ff1-6089-4b86-9c08-e99b069f8aab
5:32:25 PM:   statsd:
5:32:25 PM:     host: 10.65.78.83
5:32:25 PM:     port: 8125
5:32:25 PM:   systemLogFile: 3
5:32:25 PM:   testOpts:
5:32:25 PM:     silentLingeringProcesses: ''
5:32:25 PM: ​
5:32:25 PM: ❯ Current directory
5:32:25 PM:   /opt/build/repo
5:32:25 PM: ​
5:32:25 PM: ❯ Config file
5:32:25 PM:   /opt/build/repo/netlify.toml
5:32:25 PM: ​
5:32:25 PM: ❯ Resolved config
5:32:25 PM:   build:
5:32:25 PM:     command: npm run build
5:32:25 PM:     commandOrigin: ui
5:32:25 PM:     environment:
5:32:25 PM:       - NETLIFY_BUILD_DEBUG
5:32:25 PM:     publish: /opt/build/repo/.next
5:32:25 PM:     publishOrigin: ui
5:32:25 PM:   plugins:
5:32:25 PM:     - inputs: {}
5:32:25 PM:       origin: config
5:32:25 PM:       package: '@netlify/plugin-nextjs'
5:32:25 PM: ​
5:32:25 PM: ❯ Context
5:32:25 PM:   production
5:32:25 PM: ​
5:32:25 PM: ❯ Available plugins
5:32:25 PM:    - @algolia/netlify-plugin-crawler@1.0.0
5:32:25 PM:    - @bharathvaj/netlify-plugin-airbrake@1.0.2
5:32:25 PM:    - @chiselstrike/netlify-plugin@0.1.0
5:32:25 PM:    - @commandbar/netlify-plugin-commandbar@0.0.4
5:32:25 PM:    - @helloample/netlify-plugin-replace@1.1.4
5:32:25 PM:    - @netlify/feature-package-pilot@0.1.11
5:32:25 PM:    - @netlify/plugin-angular-universal@1.0.1
5:32:25 PM:    - @netlify/plugin-contentful-buildtime@0.0.3
5:32:25 PM:    - @netlify/plugin-emails@1.0.3
5:32:25 PM:    - @netlify/plugin-gatsby@3.6.0
5:32:25 PM:    - @netlify/plugin-lighthouse@4.0.7
5:32:25 PM:    - @netlify/plugin-nextjs@4.32.2
5:32:25 PM:    - @netlify/plugin-sitemap@0.8.1
5:32:25 PM:    - @newrelic/netlify-plugin@1.0.1
5:32:25 PM:    - @sentry/netlify-build-plugin@1.1.1
5:32:25 PM:    - @snaplet/netlify-preview-database-plugin@2.0.0
5:32:25 PM:    - @takeshape/netlify-plugin-takeshape@1.0.0
5:32:25 PM:    - @vgs/netlify-plugin-vgs@0.0.2
5:32:25 PM:    - netlify-build-plugin-dareboost@1.2.1
5:32:25 PM:    - netlify-build-plugin-debugbear@1.0.6
5:32:25 PM:    - netlify-build-plugin-perfbeacon@1.0.3
5:32:25 PM:    - netlify-build-plugin-speedcurve@2.0.0
5:32:25 PM:    - netlify-deployment-hours-plugin@0.0.10
5:32:25 PM:    - netlify-plugin-a11y@0.0.12
5:32:25 PM:    - netlify-plugin-add-instagram@0.2.2
5:32:25 PM:    - netlify-plugin-algolia-index@0.3.0
5:32:25 PM:    - netlify-plugin-amp-server-side-rendering@1.0.2
5:32:25 PM:    - netlify-plugin-brand-guardian@1.0.1
5:32:25 PM:    - netlify-plugin-build-logger@1.0.3
5:32:25 PM:    - netlify-plugin-bundle-env@0.2.2
5:32:25 PM:    - netlify-plugin-cache-nextjs@1.4.0
5:32:25 PM:    - netlify-plugin-cecil-cache@0.3.3
5:32:25 PM:    - netlify-plugin-checklinks@4.1.1
5:32:25 PM:    - netlify-plugin-chromium@1.1.4
5:32:25 PM:    - netlify-plugin-cloudinary@1.0.3
5:32:25 PM:    - netlify-plugin-contextual-env@0.3.0
5:32:25 PM:    - netlify-plugin-cypress@2.2.0
5:32:25 PM:    - netlify-plugin-debug-cache@1.0.4
5:32:25 PM:    - netlify-plugin-encrypted-files@0.0.5
5:32:25 PM:    - netlify-plugin-fetch-feeds@0.2.3
5:32:25 PM:    - netlify-plugin-flutter@1.1.0
5:32:25 PM:    - netlify-plugin-formspree@1.0.1
5:32:25 PM:    - netlify-plugin-gatsby-cache@0.3.0
5:32:25 PM:    - netlify-plugin-get-env-vars@1.0.0
5:32:25 PM:    - netlify-plugin-ghost-inspector@1.0.1
5:32:25 PM:    - netlify-plugin-ghost-markdown@3.1.0
5:32:25 PM:    - netlify-plugin-gmail@1.1.0
5:32:25 PM:    - netlify-plugin-gridsome-cache@1.0.3
5:32:25 PM:    - netlify-plugin-hashfiles@4.0.2
5:32:25 PM:    - netlify-plugin-html-validate@1.0.0
5:32:25 PM:    - netlify-plugin-hugo-cache-resources@0.2.1
5:32:25 PM:    - netlify-plugin-image-optim@0.4.0
5:32:25 PM:    - netlify-plugin-inline-critical-css@2.0.0
5:32:25 PM:    - netlify-plugin-inline-functions-env@1.0.8
5:32:25 PM:    - netlify-plugin-inline-source@1.0.4
5:32:25 PM:    - netlify-plugin-inngest@1.0.0
5:32:25 PM:    - netlify-plugin-is-website-vulnerable@2.0.3
5:32:25 PM:    - netlify-plugin-jekyll-cache@1.0.0
5:32:25 PM:    - netlify-plugin-js-obfuscator@1.0.20
5:32:25 PM:    - netlify-plugin-minify-html@0.3.1
5:32:25 PM:    - netlify-plugin-next-dynamic@1.0.9
5:32:25 PM:    - netlify-plugin-nimbella@2.1.0
5:32:25 PM:    - netlify-plugin-no-more-404@0.0.15
5:32:25 PM:    - netlify-plugin-nx-skip-build@0.0.7
5:32:25 PM:    - netlify-plugin-pagewatch@1.0.4
5:32:25 PM:    - netlify-plugin-playwright-cache@0.0.1
5:32:25 PM:    - netlify-plugin-prerender-spa@1.0.1
5:32:25 PM:    - netlify-plugin-prisma-provider@0.3.0
5:32:25 PM:    - netlify-plugin-pushover@0.1.1
5:32:25 PM:    - netlify-plugin-qawolf@1.2.0
5:32:25 PM:    - netlify-plugin-rss@0.0.8
5:32:25 PM:    - netlify-plugin-search-index@0.1.5
5:32:25 PM:    - netlify-plugin-snyk@1.2.0
5:32:25 PM:    - netlify-plugin-stepzen@1.0.4
5:32:25 PM:    - netlify-plugin-subfont@6.0.0
5:32:25 PM:    - netlify-plugin-submit-sitemap@0.4.0
5:32:25 PM:    - netlify-plugin-to-all-events@1.3.1
5:32:25 PM:    - netlify-plugin-use-env-in-runtime@1.2.1
5:32:25 PM:    - netlify-plugin-visual-diff@2.0.0
5:32:25 PM:    - netlify-plugin-webmentions@1.1.0
5:32:25 PM:    - netlify-purge-cloudflare-on-deploy@1.2.0
5:32:25 PM: ​
5:32:25 PM: ❯ Using Next.js Runtime - v4.32.2
5:32:27 PM: ​
5:32:27 PM:   1. @netlify/plugin-nextjs (onPreBuild event)                  
5:32:27 PM: ────────────────────────────────────────────────────────────────
5:32:27 PM: ​
5:32:27 PM: Step starting.
5:32:27 PM: Step started.
5:32:27 PM: Plugin logic started.
5:32:27 PM: No Next.js cache to restore.
5:32:27 PM: Plugin logic ended.
5:32:27 PM: Stop closing.
5:32:27 PM: Step ended.
5:32:27 PM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
5:32:27 PM: ​
5:32:27 PM: ❯ Updated config
5:32:27 PM:   build:
5:32:27 PM:     command: npm run build
5:32:27 PM:     commandOrigin: ui
5:32:27 PM:     environment:
5:32:27 PM:       - NETLIFY_BUILD_DEBUG
5:32:27 PM:       - NEXT_PRIVATE_TARGET
5:32:27 PM:     publish: /opt/build/repo/.next
5:32:27 PM:     publishOrigin: ui
5:32:27 PM:   plugins:
5:32:27 PM:     - inputs: {}
5:32:27 PM:       origin: config
5:32:27 PM:       package: '@netlify/plugin-nextjs'
5:32:27 PM: Step completed.
5:32:27 PM: ​
5:32:27 PM: (@netlify/plugin-nextjs onPreBuild completed in 17ms)
5:32:27 PM: Build step duration: @netlify/plugin-nextjs onPreBuild completed in 17ms
5:32:27 PM: ​
5:32:27 PM:   2. Build command from Netlify app                             
5:32:27 PM: ────────────────────────────────────────────────────────────────
5:32:27 PM: ​
5:32:27 PM: $ npm run build
5:32:27 PM: > learn_lithuanian@0.1.0 build
5:32:27 PM: > next build
5:32:27 PM: info  - Loaded env from /opt/build/repo/.env
5:32:27 PM: warn  - You have enabled experimental feature (appDir) in next.config.js.
5:32:27 PM: warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
5:32:27 PM: info  - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback
5:32:27 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
5:32:27 PM: info  - Creating an optimized production build...
5:32:31 PM: info  - Compiled successfully
5:32:31 PM: info  - Linting and checking validity of types...
5:32:32 PM: Pages directory cannot be found at /opt/build/repo/pages or /opt/build/repo/src/pages. If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.
5:32:33 PM: info  - Collecting page data...
5:32:37 PM: info  - Generating static pages (0/5)
5:32:37 PM: info  - Generating static pages (1/5)
5:32:37 PM: info  - Generating static pages (2/5)
5:32:37 PM: info  - Generating static pages (3/5)
5:32:37 PM: info  - Generating static pages (5/5)
5:32:37 PM: info  - Finalizing page optimization...
5:32:37 PM: Route (app)                                Size     First Load JS
5:32:37 PM: ┌ ○ /                                      172 B          74.5 kB
5:32:37 PM: ├ ○ /api/hello                             0 B                0 B
5:32:37 PM: └ ○ /learn                                 2.2 kB         76.5 kB
5:32:37 PM: + First Load JS shared by all              68.8 kB
5:32:37 PM:   ├ chunks/455-dd12041dc6de680b.js         66.4 kB
5:32:37 PM:   ├ chunks/main-app-b08d576ce513f540.js    203 B
5:32:37 PM:   └ chunks/webpack-596cea53c54d0255.js     2.22 kB
5:32:37 PM: Route (pages)                              Size     First Load JS
5:32:37 PM: ─ ○ /404                                   179 B          84.7 kB
5:32:37 PM: + First Load JS shared by all              84.5 kB
5:32:37 PM:   ├ chunks/main-6548d0ced9f53da0.js        82.1 kB
5:32:37 PM:   ├ chunks/pages/_app-907dedfd0e4177db.js  192 B
5:32:37 PM:   └ chunks/webpack-596cea53c54d0255.js     2.22 kB
5:32:37 PM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
5:32:38 PM: ​
5:32:38 PM: (build.command completed in 10.9s)
5:32:38 PM: Build step duration: build.command completed in 10967ms
5:32:38 PM: ​
5:32:38 PM:   3. @netlify/plugin-nextjs (onBuild event)                     
5:32:38 PM: ────────────────────────────────────────────────────────────────
5:32:38 PM: ​
5:32:38 PM: Step starting.
5:32:38 PM: Step started.
5:32:38 PM: Plugin logic started.
5:32:38 PM: Patching /opt/build/repo/node_modules/next/dist/server/base-server.js
5:32:38 PM: Done
5:32:38 PM: Patching /opt/build/repo/node_modules/next/dist/server/next-server.js
5:32:38 PM: Done
5:32:38 PM: Moving static page files to serve from CDN...
5:32:38 PM: Moved 4 files
5:32:38 PM: You are not using Netlify Edge Functions for image format detection. Set env var "NEXT_FORCE_EDGE_IMAGES=true" to enable.
5:32:38 PM: Plugin logic ended.
5:32:38 PM: Stop closing.
5:32:38 PM: Step ended.
5:32:38 PM: Netlify configuration property "functions._ipx" value changed to { node_bundler: 'nft' }.
5:32:38 PM: Netlify configuration property "functions.___netlify-handler" value changed to {
5:32:38 PM:   included_files: [
5:32:38 PM:     '.env',
5:32:38 PM:     '.env.local',
5:32:38 PM:     '.env.production',
5:32:38 PM:     '.env.production.local',
5:32:38 PM:     './public/locales/**',
5:32:38 PM:     './next-i18next.config.js',
5:32:38 PM:     '.next/server/**',
5:32:38 PM:     '.next/serverless/**',
5:32:38 PM:     '.next/*.json',
5:32:38 PM:     '.next/BUILD_ID',
5:32:38 PM:     '.next/static/chunks/webpack-middleware*.js',
5:32:38 PM:     '!.next/server/**/*.js.nft.json',
5:32:38 PM:     '!.next/server/**/*.map',
5:32:38 PM:     '!**/node_modules/@next/swc*/**/*',
5:32:38 PM:     '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*',
5:32:38 PM:     '!node_modules/next/dist/server/lib/squoosh/**/*.wasm',
5:32:38 PM:     '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm',
5:32:38 PM:     '!node_modules/next/dist/compiled/webpack/bundle4.js',
5:32:38 PM:     '!node_modules/next/dist/compiled/webpack/bundle5.js',
5:32:38 PM:     '!node_modules/sharp/**/*'
5:32:38 PM:   ],
5:32:38 PM:   external_node_modules: [],
5:32:38 PM:   node_bundler: 'nft'
5:32:38 PM: }.
5:32:38 PM: Netlify configuration property "functions.___netlify-odb-handler" value changed to {
5:32:38 PM:   included_files: [
5:32:38 PM:     '.env',
5:32:38 PM:     '.env.local',
5:32:38 PM:     '.env.production',
5:32:38 PM:     '.env.production.local',
5:32:38 PM:     './public/locales/**',
5:32:38 PM:     './next-i18next.config.js',
5:32:38 PM:     '.next/server/**',
5:32:38 PM:     '.next/serverless/**',
5:32:38 PM:     '.next/*.json',
5:32:38 PM:     '.next/BUILD_ID',
5:32:38 PM:     '.next/static/chunks/webpack-middleware*.js',
5:32:38 PM:     '!.next/server/**/*.js.nft.json',
5:32:38 PM:     '!.next/server/**/*.map',
5:32:38 PM:     '!**/node_modules/@next/swc*/**/*',
5:32:38 PM:     '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*',
5:32:38 PM:     '!node_modules/next/dist/server/lib/squoosh/**/*.wasm',
5:32:38 PM:     '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm',
5:32:38 PM:     '!node_modules/next/dist/compiled/webpack/bundle4.js',
5:32:38 PM:     '!node_modules/next/dist/compiled/webpack/bundle5.js',
5:32:38 PM:     '!node_modules/sharp/**/*'
5:32:38 PM:   ],
5:32:38 PM:   external_node_modules: [],
5:32:38 PM:   node_bundler: 'nft'
5:32:38 PM: }.
5:32:38 PM: Netlify configuration property "functions._api_*" value changed to {
5:32:38 PM:   included_files: [
5:32:38 PM:     '.env',
5:32:38 PM:     '.env.local',
5:32:38 PM:     '.env.production',
5:32:38 PM:     '.env.production.local',
5:32:38 PM:     './public/locales/**',
5:32:38 PM:     './next-i18next.config.js',
5:32:38 PM:     '.next/server/**',
5:32:38 PM:     '.next/serverless/**',
5:32:38 PM:     '.next/*.json',
5:32:38 PM:     '.next/BUILD_ID',
5:32:38 PM:     '.next/static/chunks/webpack-middleware*.js',
5:32:38 PM:     '!.next/server/**/*.js.nft.json',
5:32:38 PM:     '!.next/server/**/*.map',
5:32:38 PM:     '!**/node_modules/@next/swc*/**/*',
5:32:38 PM:     '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*',
5:32:38 PM:     '!node_modules/next/dist/server/lib/squoosh/**/*.wasm',
5:32:38 PM:     '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm',
5:32:38 PM:     '!node_modules/next/dist/compiled/webpack/bundle4.js',
5:32:38 PM:     '!node_modules/next/dist/compiled/webpack/bundle5.js',
5:32:38 PM:     '!node_modules/sharp/**/*'
5:32:38 PM:   ],
5:32:38 PM:   external_node_modules: [],
5:32:38 PM:   node_bundler: 'nft'
5:32:38 PM: }.
5:32:38 PM: Netlify configuration property "redirects" value changed to [
5:32:38 PM:   { from: '/_next/static/*', to: '/static/:splat', status: 200 },
5:32:38 PM:   {
5:32:38 PM:     from: '/_next/image*',
5:32:38 PM:     query: { url: ':url', w: ':width', q: ':quality' },
5:32:38 PM:     to: '/_ipx/w_:width,q_:quality/:url',
5:32:38 PM:     status: 301
5:32:38 PM:   },
5:32:38 PM:   { from: '/_ipx/*', to: '/.netlify/builders/_ipx', status: 200 },
5:32:38 PM:   { from: '/cache/*', to: '/404.html', status: 404, force: true },
5:32:38 PM:   { from: '/server/*', to: '/404.html', status: 404, force: true },
5:32:38 PM:   { from: '/serverless/*', to: '/404.html', status: 404, force: true },
5:32:38 PM:   { from: '/trace', to: '/404.html', status: 404, force: true },
5:32:38 PM:   { from: '/traces', to: '/404.html', status: 404, force: true },
5:32:38 PM:   {
5:32:38 PM:     from: '/routes-manifest.json',
5:32:38 PM:     to: '/404.html',
5:32:38 PM:     status: 404,
5:32:38 PM:     force: true
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/build-manifest.json',
5:32:38 PM:     to: '/404.html',
5:32:38 PM:     status: 404,
5:32:38 PM:     force: true
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/prerender-manifest.json',
5:32:38 PM:     to: '/404.html',
5:32:38 PM:     status: 404,
5:32:38 PM:     force: true
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/react-loadable-manifest.json',
5:32:38 PM:     to: '/404.html',
5:32:38 PM:     status: 404,
5:32:38 PM:     force: true
5:32:38 PM:   },
5:32:38 PM:   { from: '/BUILD_ID', to: '/404.html', status: 404, force: true },
5:32:38 PM:   {
5:32:38 PM:     from: '/api/*',
5:32:38 PM:     to: '/.netlify/functions/___netlify-handler',
5:32:38 PM:     status: 200
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/next.svg',
5:32:38 PM:     to: '/next.svg',
5:32:38 PM:     conditions: { Cookie: [Array] },
5:32:38 PM:     status: 200
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/thirteen.svg',
5:32:38 PM:     to: '/thirteen.svg',
5:32:38 PM:     conditions: { Cookie: [Array] },
5:32:38 PM:     status: 200
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/vercel.svg',
5:32:38 PM:     to: '/vercel.svg',
5:32:38 PM:     conditions: { Cookie: [Array] },
5:32:38 PM:     status: 200
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/audio/kaina.mp3',
5:32:38 PM:     to: '/audio/kaina.mp3',
5:32:38 PM:     conditions: { Cookie: [Array] },
5:32:38 PM:     status: 200
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/*',
5:32:38 PM:     to: '/.netlify/functions/___netlify-handler',
5:32:38 PM:     status: 200,
5:32:38 PM:     conditions: { Cookie: [Array] },
5:32:38 PM:     force: true
5:32:38 PM:   },
5:32:38 PM:   {
5:32:38 PM:     from: '/*',
5:32:38 PM:     to: '/.netlify/functions/___netlify-handler',
5:32:38 PM:     status: 200
5:32:38 PM:   }
5:32:38 PM: ].
5:32:38 PM: ​
5:32:38 PM: ❯ Updated config
5:32:38 PM:   build:
5:32:38 PM:     command: npm run build
5:32:38 PM:     commandOrigin: ui
5:32:38 PM:     environment:
5:32:38 PM:       - NETLIFY_BUILD_DEBUG
5:32:38 PM:       - NEXT_PRIVATE_TARGET
5:32:38 PM:     publish: /opt/build/repo/.next
5:32:38 PM:     publishOrigin: ui
5:32:38 PM:   functions:
5:32:38 PM:     ___netlify-handler:
5:32:38 PM:       external_node_modules: []
5:32:38 PM:       included_files:
5:32:38 PM:         - .env
5:32:38 PM:         - .env.local
5:32:38 PM:         - .env.production
5:32:38 PM:         - .env.production.local
5:32:38 PM:         - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!.next/server/**/*.map'
5:32:38 PM:         - '!**/node_modules/@next/swc*/**/*'
5:32:38 PM:         - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
5:32:38 PM:         - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
5:32:38 PM:         - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
5:32:38 PM:         - '!node_modules/next/dist/compiled/webpack/bundle4.js'
5:32:38 PM:         - '!node_modules/next/dist/compiled/webpack/bundle5.js'
5:32:38 PM:         - '!node_modules/sharp/**/*'
5:32:38 PM:       node_bundler: nft
5:32:38 PM:     ___netlify-odb-handler:
5:32:38 PM:       external_node_modules: []
5:32:38 PM:       included_files:
5:32:38 PM:         - .env
5:32:38 PM:         - .env.local
5:32:38 PM:         - .env.production
5:32:38 PM:         - .env.production.local
5:32:38 PM:         - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!.next/server/**/*.map'
5:32:38 PM:         - '!**/node_modules/@next/swc*/**/*'
5:32:38 PM:         - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
5:32:38 PM:         - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
5:32:38 PM:         - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
5:32:38 PM:         - '!node_modules/next/dist/compiled/webpack/bundle4.js'
5:32:38 PM:         - '!node_modules/next/dist/compiled/webpack/bundle5.js'
5:32:38 PM:         - '!node_modules/sharp/**/*'
5:32:38 PM:       node_bundler: nft
5:32:38 PM:     _api_*:
5:32:38 PM:       external_node_modules: []
5:32:38 PM:       included_files:
5:32:38 PM:         - .env
5:32:38 PM:         - .env.local
5:32:38 PM:         - .env.production
5:32:38 PM:         - .env.production.local
5:32:38 PM:         - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!.next/server/**/*.map'
5:32:38 PM:         - '!**/node_modules/@next/swc*/**/*'
5:32:38 PM:         - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
5:32:38 PM:         - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
5:32:38 PM:         - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
5:32:38 PM:         - '!node_modules/next/dist/compiled/webpack/bundle4.js'
5:32:38 PM:         - '!node_modules/next/dist/compiled/webpack/bundle5.js'
5:32:38 PM:         - '!node_modules/sharp/**/*'
5:32:38 PM:       node_bundler: nft
5:32:38 PM:     _ipx:
5:32:38 PM:       node_bundler: nft
5:32:38 PM:   plugins:
5:32:38 PM:     - inputs: {}
5:32:38 PM:       origin: config
5:32:38 PM:       package: '@netlify/plugin-nextjs'
5:32:38 PM:   redirects:
5:32:38 PM:     - from: /_next/static/*
      status: 200
      to: /static/:splat
    - from: /_next/image*
      query:
        q: ':quality'
        url: ':url'
        w: ':width'
      status: 301
      to: /_ipx/w_:width,q_:quality/:url
    - from: /_ipx/*
      status: 200
      to: /.netlify/builders/_ipx
    - force: true
      from: /cache/*
      status: 404
      to: /404.html
    - force: true
      from: /server/*
      status: 404
      to: /404.html
    - force: true
      from: /serverless/*
      status: 404
      to: /404.html
    - force: true
      from: /trace
      status: 404
      to: /404.html
    - force: true
      from: /traces
      status: 404
      to: /404.html
    - force: true
      from: /routes-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /build-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /prerender-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /react-loadable-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /BUILD_ID
      status: 404
      to: /404.html
    - from: /api/*
      status: 200
      to: /.netlify/functions/___netlify-handler
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /next.svg
      status: 200
      to: /next.svg
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /thirteen.svg
      status: 200
      to: /thirteen.svg
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /vercel.svg
      status: 200
      to: /vercel.svg
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /audio/kaina.mp3
      status: 200
      to: /audio/kaina.mp3
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      force: true
      from: /*
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /*
      status: 200
      to: /.netlify/functions/___netlify-handler
  redirectsOrigin: inline
Step completed.
5:32:38 PM: ​
5:32:38 PM: (@netlify/plugin-nextjs onBuild completed in 51ms)
5:32:38 PM: Build step duration: @netlify/plugin-nextjs onBuild completed in 51ms
5:32:38 PM: ​
5:32:38 PM:   4. Functions bundling                                         
5:32:38 PM: ────────────────────────────────────────────────────────────────
5:32:38 PM: ​
5:32:38 PM: Packaging Functions from .netlify/functions-internal directory:
5:32:38 PM:  - ___netlify-handler/___netlify-handler.js
5:32:38 PM:  - ___netlify-odb-handler/___netlify-odb-handler.js
5:32:38 PM:  - _ipx/_ipx.js
5:32:38 PM: ​
5:33:04 PM: ​
5:33:04 PM: (Functions bundling completed in 26.6s)
5:33:04 PM: Build step duration: Functions bundling completed in 26610ms
5:33:04 PM: ​
5:33:04 PM:   5. Edge Functions bundling                                    
5:33:04 PM: ────────────────────────────────────────────────────────────────
5:33:04 PM: ​
5:33:04 PM: Packaging Edge Functions from .netlify/edge-functions directory:
5:33:04 PM:  - rsc-data
5:33:04 PM: Local version of types is outdated, updating: undefined
5:33:04 PM: Using global installation of Deno CLI
5:33:05 PM: Using global installation of Deno CLI
5:33:05 PM: Using global installation of Deno CLI
5:33:05 PM: TypeError: Cannot read properties of null (reading 'endsWith')
5:33:05 PM:     at file:///opt/build/repo/.netlify/edge-functions/edge-shared/rsc-data.ts:38:48
5:33:05 PM:     at Array.filter (<anonymous>)
5:33:05 PM:     at getRscDataRouter (file:///opt/build/repo/.netlify/edge-functions/edge-shared/rsc-data.ts:38:8)
5:33:05 PM:     at file:///opt/build/repo/.netlify/edge-functions/rsc-data/rsc-data.ts:4:17
5:33:05 PM: Could not load edge function at '/opt/build/repo/.netlify/edge-functions/rsc-data/rsc-data.ts'

Part 2

5:33:05 PM: ​
5:33:05 PM:   Internal error during "Edge Functions bundling"               
5:33:05 PM: ────────────────────────────────────────────────────────────────
5:33:05 PM: ​
5:33:05 PM:   Error message
5:33:05 PM:   TypeError: Expected a string
5:33:05 PM: ​
5:33:05 PM:   Error location
5:33:05 PM:   During Edge Functions bundling
5:33:05 PM:       at module.exports (/opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/node_modules/glob-to-regexp/index.js:3:11)
5:33:05 PM:       at pathToRegularExpression (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/dist/node/manifest.js:80:31)
5:33:05 PM:       at getRegularExpression (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/dist/node/manifest.js:101:12)
5:33:05 PM:       at file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/dist/node/manifest.js:44:25
5:33:05 PM:       at Array.forEach (<anonymous>)
5:33:05 PM:       at generateManifest (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/dist/node/manifest.js:39:18)
5:33:05 PM:       at writeManifest (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/dist/node/manifest.js:122:22)
5:33:05 PM:       at bundle (file:///opt/buildhome/node-deps/node_modules/@netlify/edge-bundler/dist/node/bundler.js:75:28)
5:33:05 PM:       at runMicrotasks (<anonymous>)
5:33:05 PM:       at processTicksAndRejections (node:internal/process/task_queues:96:5)
5:33:05 PM: ​
5:33:05 PM:   Resolved config
5:33:05 PM:   build:
5:33:05 PM:     command: npm run build
5:33:05 PM:     commandOrigin: ui
5:33:06 PM: Failed during stage 'building site': Build script returned non-zero exit code: 4 (https://ntl.fyi/exit-code-4)
5:33:05 PM:     environment:
5:33:05 PM:       - NETLIFY_BUILD_DEBUG
5:33:05 PM:       - NEXT_PRIVATE_TARGET
5:33:05 PM:     publish: /opt/build/repo/.next
5:33:05 PM:     publishOrigin: ui
5:33:05 PM:   functions:
5:33:05 PM:     ___netlify-handler:
5:33:05 PM:       external_node_modules: []
5:33:05 PM:       included_files:
5:33:05 PM:         - .env
5:33:05 PM:         - .env.local
5:33:05 PM:         - .env.production
5:33:05 PM:         - .env.production.local
5:33:05 PM:         - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!.next/server/**/*.map'
5:33:05 PM:         - '!**/node_modules/@next/swc*/**/*'
5:33:05 PM:         - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
5:33:05 PM:         - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
5:33:05 PM:         - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
5:33:05 PM:         - '!node_modules/next/dist/compiled/webpack/bundle4.js'
5:33:05 PM:         - '!node_modules/next/dist/compiled/webpack/bundle5.js'
5:33:05 PM:         - '!node_modules/sharp/**/*'
5:33:05 PM:       node_bundler: nft
5:33:05 PM:     ___netlify-odb-handler:
5:33:05 PM:       external_node_modules: []
5:33:05 PM:       included_files:
5:33:05 PM:         - .env
5:33:05 PM:         - .env.local
5:33:05 PM:         - .env.production
5:33:05 PM:         - .env.production.local
5:33:05 PM:         - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!.next/server/**/*.map'
5:33:05 PM:         - '!**/node_modules/@next/swc*/**/*'
5:33:05 PM:         - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
5:33:05 PM:         - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
5:33:05 PM:         - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
5:33:05 PM:         - '!node_modules/next/dist/compiled/webpack/bundle4.js'
5:33:05 PM:         - '!node_modules/next/dist/compiled/webpack/bundle5.js'
5:33:05 PM:         - '!node_modules/sharp/**/*'
5:33:05 PM:       node_bundler: nft
5:33:05 PM:     _api_*:
5:33:05 PM:       external_node_modules: []
5:33:05 PM:       included_files:
5:33:05 PM:         - .env
5:33:05 PM:         - .env.local
5:33:05 PM:         - .env.production
5:33:05 PM:         - .env.production.local
5:33:05 PM:         - ./public/locales/**
        - ./next-i18next.config.js
        - .next/server/**
        - .next/serverless/**
        - .next/*.json
        - .next/BUILD_ID
        - .next/static/chunks/webpack-middleware*.js
        - '!.next/server/**/*.js.nft.json'
        - '!.next/server/**/*.map'
5:33:05 PM:         - '!**/node_modules/@next/swc*/**/*'
5:33:05 PM:         - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
5:33:05 PM:         - '!node_modules/next/dist/server/lib/squoosh/**/*.wasm'
5:33:05 PM:         - '!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm'
5:33:05 PM:         - '!node_modules/next/dist/compiled/webpack/bundle4.js'
5:33:05 PM:         - '!node_modules/next/dist/compiled/webpack/bundle5.js'
5:33:05 PM:         - '!node_modules/sharp/**/*'
5:33:05 PM:       node_bundler: nft
5:33:05 PM:     _ipx:
5:33:05 PM:       node_bundler: nft
5:33:05 PM:   plugins:
5:33:05 PM:     - inputs: {}
5:33:05 PM:       origin: config
5:33:05 PM:       package: '@netlify/plugin-nextjs'
5:33:05 PM:   redirects:
5:33:06 PM:     - from: /_next/static/*
      status: 200
      to: /static/:splat
    - from: /_next/image*
      query:
        q: ':quality'
        url: ':url'
        w: ':width'
      status: 301
      to: /_ipx/w_:width,q_:quality/:url
    - from: /_ipx/*
      status: 200
      to: /.netlify/builders/_ipx
    - force: true
      from: /cache/*
      status: 404
      to: /404.html
    - force: true
      from: /server/*
      status: 404
      to: /404.html
    - force: true
      from: /serverless/*
      status: 404
      to: /404.html
    - force: true
      from: /trace
      status: 404
      to: /404.html
    - force: true
      from: /traces
      status: 404
      to: /404.html
    - force: true
      from: /routes-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /build-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /prerender-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /react-loadable-manifest.json
      status: 404
      to: /404.html
    - force: true
      from: /BUILD_ID
      status: 404
      to: /404.html
    - from: /api/*
      status: 200
      to: /.netlify/functions/___netlify-handler
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /next.svg
      status: 200
      to: /next.svg
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /thirteen.svg
      status: 200
      to: /thirteen.svg
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /vercel.svg
      status: 200
      to: /vercel.svg
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      from: /audio/kaina.mp3
      status: 200
      to: /audio/kaina.mp3
    - conditions:
        Cookie:
          - __prerender_bypass
          - __next_preview_data
      force: true
      from: /*
      status: 200
      to: /.netlify/functions/___netlify-handler
    - from: /*
      status: 200
      to: /.netlify/functions/___netlify-handler
  redirectsOrigin: inline
Caching artifacts
5:33:06 PM: Started saving node modules
5:33:06 PM: Finished saving node modules
5:33:06 PM: Started saving build plugins
5:33:06 PM: Finished saving build plugins
5:33:06 PM: Started saving corepack cache
5:33:06 PM: Finished saving corepack cache
5:33:06 PM: Started saving pip cache
5:33:06 PM: Finished saving pip cache
5:33:06 PM: Started saving emacs cask dependencies
5:33:06 PM: Finished saving emacs cask dependencies
5:33:06 PM: Started saving maven dependencies
5:33:06 PM: Finished saving maven dependencies
5:33:06 PM: Started saving boot dependencies
5:33:06 PM: Finished saving boot dependencies
5:33:06 PM: Started saving rust rustup cache
5:33:06 PM: Finished saving rust rustup cache
5:33:06 PM: Started saving go dependencies
5:33:06 PM: Finished saving go dependencies
5:33:06 PM: Build failed due to an internal system error: Build script returned non-zero exit code: 4
5:33:06 PM: Failing build: Failed to build site
5:33:06 PM: Finished processing build request in 55.53s

Also I dont get any errors with npm run build

Please check out: Bug: `appDir` applications can have `dataRoute: null` · Issue #1940 · netlify/next-runtime · GitHub