Missing Key results deployment fail

I had 2 deployment, First failed and the second deployed. The only difference is that I added key to a component. Nothing more.

Is this normal behavior? If yes, the log not helping at all in finding the issue.

9:47:16 PM: build-image version: 5e2052dbf11f1636a7bac1839aff8991d186d620 (focal)
9:47:16 PM: buildbot version: 5e2052dbf11f1636a7bac1839aff8991d186d620
9:47:16 PM: Fetching cached dependencies
9:47:16 PM: Starting to download cache of 163.6MB
9:47:18 PM: Finished downloading cache in 1.599s
9:47:18 PM: Starting to extract cache
9:47:19 PM: Finished extracting cache in 1.181s
9:47:19 PM: Finished fetching cache in 2.842s
9:47:19 PM: Starting to prepare the repo for build
9:47:19 PM: Preparing Git Reference refs/heads/main
9:47:20 PM: Parsing package.json dependencies
9:47:21 PM: ​❯ Initial build environmentbaseRelDir: truebranch: maincontext: productioncwd: /opt/build/repofeatureFlags: []mode: buildbotrepositoryRoot: /opt/build/repositeId: 5d259ff1-6089-4b86-9c08-e99b069f8aab​❯ UI build settingsbaseRelDir: truebuild:  command: npm run build  environment:    - NETLIFY_BUILD_DEBUG  publish: .next​❯ Resolved build environmentbranch: mainbuildDir: /opt/build/repoconfigPath: /opt/build/repo/netlify.tomlcontext: productionenv: []​❯ Resolved configbuild:  command: npm run build  commandOrigin: ui  environment:    - NETLIFY_BUILD_DEBUG  publish: /opt/build/repo/.next  publishOrigin: uiplugins:  - inputs: {}    origin: config    package: '@netlify/plugin-nextjs'
9:47:22 PM: Starting to install dependencies
9:47:22 PM: Python version set to 3.8
9:47:22 PM: Attempting Ruby version 2.7.2, read from environment
9:47:22 PM: Using Ruby version 2.7.2
9:47:23 PM: Started restoring cached go cache
9:47:23 PM: Finished restoring cached go cache
9:47:23 PM: Installing Go version 1.19.5 (requested 1.19.5)
9:47:28 PM: go version go1.19.5 linux/amd64
9:47:28 PM: Using PHP version 8.0
9:47:29 PM: Started restoring cached Node.js version
9:47:29 PM: Finished restoring cached Node.js version
9:47:30 PM: v16.19.1 is already installed.
9:47:30 PM: Now using node v16.19.1 (npm v8.19.3)
9:47:30 PM: Enabling Node.js Corepack
9:47:30 PM: Started restoring cached build plugins
9:47:30 PM: Finished restoring cached build plugins
9:47:30 PM: Started restoring cached corepack dependencies
9:47:30 PM: Finished restoring cached corepack dependencies
9:47:30 PM: No npm workspaces detected
9:47:30 PM: Started restoring cached node modules
9:47:30 PM: Finished restoring cached node modules
9:47:30 PM: Installing npm packages using npm version 8.19.3
9:47:31 PM: up to date, audited 432 packages in 629ms
9:47:31 PM: 134 packages are looking for funding
9:47:31 PM:   run `npm fund` for details
9:47:31 PM: found 0 vulnerabilities
9:47:31 PM: npm packages installed
9:47:32 PM: Install dependencies script success
9:47:32 PM: Starting build script
9:47:32 PM: Using stage install dependencies
9:47:32 PM: Detected 1 framework(s)
9:47:32 PM: "next" at version "13.2.4"
9:47:32 PM: Section completed: initializing
9:47:34 PM: ​
9:47:34 PM:   Netlify Build                                                 
9:47:34 PM: ────────────────────────────────────────────────────────────────
9:47:34 PM: ​
9:47:34 PM: ❯ Version
9:47:34 PM:   @netlify/build 29.7.1
9:47:34 PM: ​
9:47:34 PM: ❯ Flags
9:47:34 PM:   apiHost: api.netlify.com
9:47:34 PM:   baseRelDir: true
9:47:34 PM:   branch: main
9:47:34 PM:   buildId: 6421e4b155480e0008e31469
9:47:34 PM:   buildbotServerSocket: /tmp/netlify-buildbot-socket
9:47:34 PM:   cacheDir: /opt/build/cache
9:47:34 PM:   cachedConfigPath: /tmp/netlify_config.json
9:47:34 PM:   context: production
9:47:34 PM:   cwd: /opt/build/repo
9:47:34 PM:   deployId: 6421e4b155480e0008e3146b
9:47:34 PM:   edgeFunctionsDistDir: /tmp/edge-6421e4b155480e0008e3146b
9:47:34 PM:   featureFlags:
9:47:34 PM:     - edge_functions_cache_cli
9:47:34 PM:     - edge_functions_system_logger
9:47:34 PM:   framework: next
9:47:34 PM:   functionsDistDir: /tmp/zisi-6421e4b155480e0008e3146b
9:47:34 PM:   mode: buildbot
9:47:34 PM:   nodePath: /opt/buildhome/.nvm/versions/node/v16.19.1/bin/node
9:47:34 PM:   repositoryRoot: /opt/build/repo
9:47:34 PM:   saveConfig: true
9:47:34 PM:   sendStatus: true
9:47:34 PM:   siteId: 5d259ff1-6089-4b86-9c08-e99b069f8aab
9:47:34 PM:   statsd:
9:47:34 PM:     host: 10.65.154.19
9:47:34 PM:     port: 8125
9:47:34 PM:   systemLogFile: 3
9:47:34 PM:   testOpts:
9:47:34 PM:     silentLingeringProcesses: ''
9:47:34 PM: ​
9:47:34 PM: ❯ Current directory
9:47:34 PM:   /opt/build/repo
9:47:34 PM: ​
9:47:34 PM: ❯ Config file
9:47:34 PM:   /opt/build/repo/netlify.toml
9:47:34 PM: ​
9:47:34 PM: ❯ Resolved config
9:47:34 PM:   build:
9:47:34 PM:     command: npm run build
9:47:34 PM:     commandOrigin: ui
9:47:34 PM:     environment:
9:47:34 PM:       - NETLIFY_BUILD_DEBUG
9:47:34 PM:     publish: /opt/build/repo/.next
9:47:34 PM:     publishOrigin: ui
9:47:34 PM:   plugins:
9:47:34 PM:     - inputs: {}
9:47:34 PM:       origin: config
9:47:34 PM:       package: '@netlify/plugin-nextjs'
9:47:34 PM: ​
9:47:34 PM: ❯ Context
9:47:34 PM:   production
9:47:34 PM: ​
9:47:34 PM: ❯ Available plugins
9:47:34 PM:    - @algolia/netlify-plugin-crawler@1.0.0
9:47:34 PM:    - @bharathvaj/netlify-plugin-airbrake@1.0.2
9:47:34 PM:    - @chiselstrike/netlify-plugin@0.1.0
9:47:34 PM:    - @commandbar/netlify-plugin-commandbar@0.0.4
9:47:34 PM:    - @helloample/netlify-plugin-replace@1.1.4
9:47:34 PM:    - @netlify/feature-package-pilot@0.1.11
9:47:34 PM:    - @netlify/plugin-angular-universal@1.0.1
9:47:34 PM:    - @netlify/plugin-contentful-buildtime@0.0.3
9:47:34 PM:    - @netlify/plugin-emails@1.0.3
9:47:34 PM:    - @netlify/plugin-gatsby@3.6.0
9:47:34 PM:    - @netlify/plugin-lighthouse@4.0.7
9:47:34 PM:    - @netlify/plugin-nextjs@4.33.0
9:47:34 PM:    - @netlify/plugin-sitemap@0.8.1
9:47:34 PM:    - @newrelic/netlify-plugin@1.0.2
9:47:34 PM:    - @sentry/netlify-build-plugin@1.1.1
9:47:34 PM:    - @snaplet/netlify-preview-database-plugin@2.0.0
9:47:34 PM:    - @takeshape/netlify-plugin-takeshape@1.0.0
9:47:34 PM:    - @vgs/netlify-plugin-vgs@0.0.2
9:47:34 PM:    - netlify-build-plugin-dareboost@1.2.1
9:47:34 PM:    - netlify-build-plugin-debugbear@1.0.6
9:47:34 PM:    - netlify-build-plugin-perfbeacon@1.0.3
9:47:34 PM:    - netlify-build-plugin-speedcurve@2.0.0
9:47:34 PM:    - netlify-deployment-hours-plugin@0.0.10
9:47:34 PM:    - netlify-plugin-a11y@0.0.12
9:47:34 PM:    - netlify-plugin-add-instagram@0.2.2
9:47:34 PM:    - netlify-plugin-algolia-index@0.3.0
9:47:34 PM:    - netlify-plugin-amp-server-side-rendering@1.0.2
9:47:34 PM:    - netlify-plugin-brand-guardian@1.0.1
9:47:34 PM:    - netlify-plugin-build-logger@1.0.3
9:47:34 PM:    - netlify-plugin-bundle-env@0.2.2
9:47:34 PM:    - netlify-plugin-cache-nextjs@1.4.0
9:47:34 PM:    - netlify-plugin-cecil-cache@0.3.3
9:47:34 PM:    - netlify-plugin-checklinks@4.1.1
9:47:34 PM:    - netlify-plugin-chromium@1.1.4
9:47:34 PM:    - netlify-plugin-cloudinary@1.0.3
9:47:34 PM:    - netlify-plugin-contextual-env@0.3.0
9:47:34 PM:    - netlify-plugin-cypress@2.2.0
9:47:34 PM:    - netlify-plugin-debug-cache@1.0.4
9:47:34 PM:    - netlify-plugin-encrypted-files@0.0.5
9:47:34 PM:    - netlify-plugin-fetch-feeds@0.2.3
9:47:34 PM:    - netlify-plugin-flutter@1.1.0
9:47:34 PM:    - netlify-plugin-formspree@1.0.1
9:47:34 PM:    - netlify-plugin-gatsby-cache@0.3.0
9:47:34 PM:    - netlify-plugin-get-env-vars@1.0.0
9:47:34 PM:    - netlify-plugin-ghost-inspector@1.0.1
9:47:34 PM:    - netlify-plugin-ghost-markdown@3.1.0
9:47:34 PM:    - netlify-plugin-gmail@1.1.0
9:47:34 PM:    - netlify-plugin-gridsome-cache@1.0.3
9:47:34 PM:    - netlify-plugin-hashfiles@4.0.2
9:47:34 PM:    - netlify-plugin-html-validate@1.0.0
9:47:34 PM:    - netlify-plugin-hugo-cache-resources@0.2.1
9:47:34 PM:    - netlify-plugin-image-optim@0.4.0
9:47:34 PM:    - netlify-plugin-inline-critical-css@2.0.0
9:47:34 PM:    - netlify-plugin-inline-functions-env@1.0.8
9:47:34 PM:    - netlify-plugin-inline-source@1.0.4
9:47:34 PM:    - netlify-plugin-inngest@1.0.0
9:47:34 PM:    - netlify-plugin-is-website-vulnerable@2.0.3
9:47:34 PM:    - netlify-plugin-jekyll-cache@1.0.0
9:47:34 PM:    - netlify-plugin-js-obfuscator@1.0.20
9:47:34 PM:    - netlify-plugin-minify-html@0.3.1
9:47:34 PM:    - netlify-plugin-next-dynamic@1.0.9
9:47:34 PM:    - netlify-plugin-nimbella@2.1.0
9:47:34 PM:    - netlify-plugin-no-more-404@0.0.15
9:47:34 PM:    - netlify-plugin-nx-skip-build@0.0.7
9:47:34 PM:    - netlify-plugin-pagewatch@1.0.4
9:47:34 PM:    - netlify-plugin-playwright-cache@0.0.1
9:47:34 PM:    - netlify-plugin-prerender-spa@1.0.1
9:47:34 PM:    - netlify-plugin-prisma-provider@0.3.0
9:47:34 PM:    - netlify-plugin-pushover@0.1.1
9:47:34 PM:    - netlify-plugin-qawolf@1.2.0
9:47:34 PM:    - netlify-plugin-rss@0.0.8
9:47:34 PM:    - netlify-plugin-search-index@0.1.5
9:47:34 PM:    - netlify-plugin-snyk@1.2.0
9:47:34 PM:    - netlify-plugin-stepzen@1.0.4
9:47:34 PM:    - netlify-plugin-subfont@6.0.0
9:47:34 PM:    - netlify-plugin-submit-sitemap@0.4.0
9:47:34 PM:    - netlify-plugin-to-all-events@1.3.1
9:47:34 PM:    - netlify-plugin-use-env-in-runtime@1.2.1
9:47:34 PM:    - netlify-plugin-visual-diff@2.0.0
9:47:34 PM:    - netlify-plugin-webmentions@1.1.0
9:47:34 PM:    - netlify-purge-cloudflare-on-deploy@1.2.0
9:47:34 PM: ​
9:47:34 PM: ❯ Using Next.js Runtime - v4.29.5-appdir.0
9:47:34 PM: ​
9:47:34 PM: ❯ Outdated plugins
9:47:34 PM:    - @netlify/plugin-nextjs@4.29.5-appdir.0: latest version is 4.33.0
9:47:34 PM:      To upgrade this plugin, please update its version in "package.json"
9:47:35 PM: ​
9:47:35 PM:   1. @netlify/plugin-nextjs (onPreBuild event)                  
9:47:35 PM: ────────────────────────────────────────────────────────────────
9:47:35 PM: ​
9:47:35 PM: Step starting.
9:47:35 PM: Step started.
9:47:35 PM: Plugin logic started.
9:47:35 PM: Next.js cache restored.
9:47:35 PM: Plugin logic ended.
9:47:35 PM: Stop closing.
9:47:35 PM: Step ended.
9:47:35 PM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
9:47:35 PM: ​
9:47:35 PM: ❯ Updated config
9:47:35 PM:   build:
9:47:35 PM:     command: npm run build
9:47:35 PM:     commandOrigin: ui
9:47:35 PM:     environment:
9:47:35 PM:       - NETLIFY_BUILD_DEBUG
9:47:35 PM:       - NEXT_PRIVATE_TARGET
9:47:35 PM:     publish: /opt/build/repo/.next
9:47:35 PM:     publishOrigin: ui
9:47:35 PM:   plugins:
9:47:35 PM:     - inputs: {}
9:47:35 PM:       origin: config
9:47:35 PM:       package: '@netlify/plugin-nextjs'
9:47:35 PM: Step completed.
9:47:35 PM: ​
9:47:35 PM: (@netlify/plugin-nextjs onPreBuild completed in 76ms)
9:47:35 PM: Build step duration: @netlify/plugin-nextjs onPreBuild completed in 76ms
9:47:35 PM: ​
9:47:35 PM:   2. Build command from Netlify app                             
9:47:35 PM: ────────────────────────────────────────────────────────────────
9:47:35 PM: ​
9:47:35 PM: $ npm run build
9:47:36 PM: > learn_lithuanian@0.1.0 build
9:47:36 PM: > next build
9:47:36 PM: warn  - You have enabled experimental feature (appDir) in next.config.js.
9:47:36 PM: warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
9:47:42 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:47:36 PM: info  - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback
9:47:36 PM: info  - Creating an optimized production build...
9:47:39 PM: info  - Compiled successfully
9:47:39 PM: info  - Linting and checking validity of types...
9:47:40 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.
9:47:40 PM: 
9:47:40 PM: Failed to compile.
9:47:40 PM: ./src/app/learn/flashcard/flashcardDisplay.jsx
9:47:40 PM: 32:7  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
9:47:40 PM: 45:11  Warning: Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
9:47:40 PM: ./src/app/learn/page.jsx
9:47:40 PM: 31:15  Error: Missing "key" prop for element in iterator  react/jsx-key
9:47:40 PM: ./src/components/AudioButton.jsx
9:47:40 PM: 9:7  Warning: The 'song' object construction makes the dependencies of useEffect Hook (at line 40) change on every render. To fix this, wrap the initialization of 'song' in its own useMemo() Hook.  react-hooks/exhaustive-deps
9:47:40 PM: 67:11  Warning: Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
9:47:40 PM: info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
9:47:40 PM: ​
9:47:40 PM:   "build.command" failed                                        
9:47:40 PM: ────────────────────────────────────────────────────────────────
9:47:40 PM: ​
9:47:40 PM:   Error message
9:47:40 PM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
9:47:40 PM: ​
9:47:40 PM:   Error location
9:47:40 PM:   In Build command from Netlify app:
9:47:40 PM:   npm run build
9:47:40 PM: ​
9:47:40 PM:   Resolved config
9:47:40 PM:   build:
9:47:40 PM:     command: npm run build
9:47:40 PM:     commandOrigin: ui
9:47:40 PM:     environment:
9:47:40 PM:       - NETLIFY_BUILD_DEBUG
9:47:40 PM:       - NEXT_PRIVATE_TARGET
9:47:40 PM:     publish: /opt/build/repo/.next
9:47:40 PM:     publishOrigin: ui
9:47:40 PM:   plugins:
9:47:40 PM:     - inputs: {}
9:47:40 PM:       origin: config
9:47:40 PM:       package: '@netlify/plugin-nextjs'
9:47:40 PM: Caching artifacts
9:47:40 PM: Started saving node modules
9:47:40 PM: Finished saving node modules
9:47:40 PM: Started saving build plugins
9:47:40 PM: Finished saving build plugins
9:47:40 PM: Started saving corepack cache
9:47:40 PM: Finished saving corepack cache
9:47:40 PM: Started saving pip cache
9:47:40 PM: Finished saving pip cache
9:47:40 PM: Started saving emacs cask dependencies
9:47:40 PM: Finished saving emacs cask dependencies
9:47:40 PM: Started saving maven dependencies
9:47:40 PM: Finished saving maven dependencies
9:47:40 PM: Started saving boot dependencies
9:47:40 PM: Finished saving boot dependencies
9:47:40 PM: Started saving rust rustup cache
9:47:40 PM: Finished saving rust rustup cache
9:47:40 PM: Started saving go dependencies
9:47:40 PM: Finished saving go dependencies
9:47:42 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:47:42 PM: Failing build: Failed to build site
9:47:42 PM: Finished processing build request in 25.878s

Hi there, before we can help you, we need a little more information on the issues you are facing.

First, have you looked through this resource? It is a compilation of all of our build and deploy resources. This is a good starting point.

If you have worked through those guides and are still encountering issues please share the following information:

  • the name of your build instance: “example-jones.netlify.com
  • what you have already tried
  • any error messages you have received in your terminal window or in the developer console