Deployment Error - exit code 137 - Build failed due to a user error

I seemed to have a build error in my file when I introduce netlify.toml with a redirect to index.html.
The logs do not tell me the exact error and was wondering if anyone could help me out on this or have any ideas on why the error is appearing.

Netlify site name: bundles-static.netlify.app

Deploy Reference: Netlify App

Build Log:

3:45:07 PM: Waiting for other deploys from your team to complete. Check the queue: https://app.netlify.com/teams/yizhuang-chew/builds
3:45:32 PM: build-image version: 4e021f34e58c8c6c6ee69b078ac3e861fee3ee31 (focal)
3:45:32 PM: buildbot version: 4e021f34e58c8c6c6ee69b078ac3e861fee3ee31
3:45:32 PM: Building without cache
3:45:32 PM: Starting to prepare the repo for build
3:45:33 PM: No cached dependencies found. Cloning fresh repo
3:45:33 PM: git clone --filter=blob:none https://github.com/yizhuang-chew/bundles
3:45:33 PM: Preparing Git Reference refs/heads/master
3:45:35 PM: Parsing package.json dependencies
3:45:36 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'packages/bundles-static/public' versus 'public' in the Netlify UI
3:45:36 PM: Starting to install dependencies
3:45:37 PM: Downloading and installing node v16.20.0...
3:45:37 PM: Downloading https://nodejs.org/dist/v16.20.0/node-v16.20.0-linux-x64.tar.xz...
3:45:37 PM: Computing checksum with sha256sum
3:45:37 PM: Checksums matched!
3:45:39 PM: Now using node v16.20.0 (npm v8.19.4)
3:45:39 PM: Enabling Node.js Corepack
3:45:39 PM: Started restoring cached build plugins
3:45:39 PM: Finished restoring cached build plugins
3:45:39 PM: Started restoring cached corepack dependencies
3:45:39 PM: Finished restoring cached corepack dependencies
3:45:39 PM: Started restoring cached yarn cache
3:45:39 PM: Finished restoring cached yarn cache
3:45:39 PM: yarn workspaces detected
3:45:39 PM: Installing npm packages using Yarn version 1.22.19
3:45:40 PM: yarn install v1.22.19
3:45:40 PM: [1/4] Resolving packages...
3:45:40 PM: [2/4] Fetching packages...
3:46:10 PM: [3/4] Linking dependencies...
3:46:10 PM: warning "workspace-aggregator-a0b4530c-17d1-41e4-bed2-2ff72ed6a7a4 > @commercetools-us-ps-local/bundles-core > @testing-library/react@13.4.0" has incorrect peer dependency "react@^18.0.0".
3:46:10 PM: warning "workspace-aggregator-a0b4530c-17d1-41e4-bed2-2ff72ed6a7a4 > @commercetools-us-ps-local/bundles-core > @testing-library/react@13.4.0" has incorrect peer dependency "react-dom@^18.0.0".
3:46:10 PM: warning "workspace-aggregator-a0b4530c-17d1-41e4-bed2-2ff72ed6a7a4 > @commercetools-us-ps-local/bundles-core > eslint-config-airbnb-base@14.2.1" has incorrect peer dependency "eslint@^5.16.0 || ^6.8.0 || ^7.2.0".
3:46:10 PM: warning "workspace-aggregator-a0b4530c-17d1-41e4-bed2-2ff72ed6a7a4 > @commercetools-us-ps-local/bundles-core > jest-runner-eslint@0.11.1" has incorrect peer dependency "eslint@^6 || ^7".
3:46:10 PM: warning "workspace-aggregator-a0b4530c-17d1-41e4-bed2-2ff72ed6a7a4 > @commercetools-us-ps/mc-app-bundles-dynamic > @commercetools-frontend/application-shell@21.20.3" has incorrect peer dependency "@testing-library/react@12.x".
3:46:10 PM: warning "workspace-aggregator-a0b4530c-17d1-41e4-bed2-2ff72ed6a7a4 > @commercetools-us-ps/mc-app-bundles-dynamic > @commercetools-frontend/mc-scripts > @rollup/plugin-graphql@1.1.0" has unmet peer dependency "rollup@^1.20.0 || ^2.0.0".
3:48:51 PM: [4/4] Building fresh packages...
3:48:56 PM: success Saved lockfile.
3:48:56 PM: Done in 196.06s.
3:48:56 PM: npm packages installed using Yarn
3:48:56 PM: Started restoring cached go cache
3:48:56 PM: Finished restoring cached go cache
3:48:56 PM: Installing Go version 1.19.5 (requested 1.19.5)
3:49:01 PM: go version go1.19.5 linux/amd64
3:49:01 PM: Python version set to 3.8
3:49:02 PM: Attempting Ruby version 2.7.2, read from environment
3:49:02 PM: Using Ruby version 2.7.2
3:49:03 PM: Using PHP version 8.0
3:49:03 PM: Install dependencies script success
3:49:03 PM: Starting build script
3:49:03 PM: Using stage install dependencies
3:49:03 PM: Detected 0 framework(s)
3:49:03 PM: Section completed: initializing
3:49:05 PM: ​
3:49:05 PM:   Netlify Build                                                 
3:49:05 PM: ────────────────────────────────────────────────────────────────
3:49:05 PM: ​
3:49:05 PM: ❯ Version
3:49:05 PM:   @netlify/build 29.8.0
3:49:05 PM: ​
3:49:05 PM: ❯ Flags
3:49:05 PM:   baseRelDir: true
3:49:05 PM:   buildId: 64253e0312285e2dddc5b5af
3:49:05 PM:   deployId: 64253e0312285e2dddc5b5b1
3:49:05 PM: ​
3:49:05 PM: ❯ Current directory
3:49:05 PM:   /opt/build/repo/packages/bundles-static
3:49:05 PM: ​
3:49:05 PM: ❯ Config file
3:49:05 PM:   /opt/build/repo/packages/bundles-static/netlify.toml
3:49:05 PM: ​
3:49:05 PM: ❯ Context
3:49:05 PM:   production
3:49:05 PM: ​
3:49:05 PM:   1. Build command from Netlify app                             
3:49:05 PM: ────────────────────────────────────────────────────────────────
3:49:05 PM: ​
3:49:05 PM: $ CI= yarn build
3:49:05 PM: yarn run v1.22.19
3:49:05 PM: $ mc-scripts build compile-html
3:49:05 PM: Creating an optimized production build...
3:49:09 PM: Browserslist: caniuse-lite is outdated. Please run:
3:49:09 PM:   npx update-browserslist-db@latest
3:49:09 PM:   Why you should do it regularly: https://github.com/browserslist/update-db#readme
3:49:12 PM: Browserslist: caniuse-lite is outdated. Please run:
3:49:12 PM:   npx update-browserslist-db@latest
3:49:12 PM:   Why you should do it regularly: https://github.com/browserslist/update-db#readme
3:49:24 PM: Browserslist: caniuse-lite is outdated. Please run:
3:49:24 PM:   npx update-browserslist-db@latest
3:49:24 PM:   Why you should do it regularly: https://github.com/browserslist/update-db#readme
3:49:46 PM: Killed
3:49:46 PM: error Command failed with exit code 137. (https://ntl.fyi/exit-code-137)
3:49:46 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
3:49:46 PM: ​
3:49:46 PM:   "build.command" failed                                        
3:49:46 PM: ────────────────────────────────────────────────────────────────
3:49:46 PM: ​
3:49:46 PM:   Error message
3:49:46 PM:   Command failed with exit code 137: CI= yarn build (https://ntl.fyi/exit-code-137)
3:49:46 PM: ​
3:49:46 PM:   Error location
3:49:46 PM:   In Build command from Netlify app:
3:49:46 PM:   CI= yarn build
3:49:46 PM: ​
3:49:46 PM:   Resolved config
3:49:46 PM:   build:
3:49:46 PM:     base: /opt/build/repo/packages/bundles-static
3:49:46 PM:     command: CI= yarn build
3:49:46 PM:     commandOrigin: ui
3:49:46 PM:     environment:
3:49:46 PM:       - APPLICATION_ID
3:49:46 PM:       - APPLICATION_URL
3:49:46 PM:       - CI
3:49:46 PM:       - CLOUD_IDENTIFIER
3:49:46 PM:       - INITIAL_PROJECT_KEY
3:49:46 PM:       - NPM_FLAGS
3:49:46 PM:     publish: /opt/build/repo/packages/bundles-static/public
3:49:46 PM:     publishOrigin: ui
3:49:46 PM:   redirects:
3:49:47 PM:     - from: /*
      status: 200
      to: /index.html
  redirectsOrigin: config
Caching artifacts
3:49:47 PM: Started saving node modules
3:49:47 PM: Finished saving node modules
3:49:47 PM: Started saving build plugins
3:49:47 PM: Finished saving build plugins
3:49:47 PM: Started saving corepack cache
3:49:47 PM: Finished saving corepack cache
3:49:47 PM: Started saving yarn cache
3:51:17 PM: Finished saving yarn cache
3:51:17 PM: Started saving pip cache
3:51:17 PM: Finished saving pip cache
3:51:17 PM: Started saving emacs cask dependencies
3:51:17 PM: Finished saving emacs cask dependencies
3:51:17 PM: Started saving maven dependencies
3:51:17 PM: Finished saving maven dependencies
3:51:17 PM: Started saving boot dependencies
3:51:17 PM: Finished saving boot dependencies
3:51:17 PM: Started saving rust rustup cache
3:51:17 PM: Finished saving rust rustup cache
3:51:17 PM: Started saving go dependencies
3:51:17 PM: Finished saving go dependencies
3:51:21 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:51:21 PM: Failing build: Failed to build site
3:51:21 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
3:51:21 PM: Finished processing build request in 5m48.603s

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 and your site name etc. Thanks!