Deploy Fail -- Failed during stage 'building site': Build script returned non-zero exit code: 2

Any help would be much appreciated! Thanks :slight_smile:

Netlify site name: magical-dieffenbachia-3761fc.netlify.app

Attempted Deply Log:

12:27:25 AM: Build ready to start
12:27:27 AM: build-image version: 0e2f4c52031ab562db66aec633308326e3b108d0 (focal)
12:27:27 AM: build-image tag: focal
12:27:27 AM: buildbot version: 8dba8e08e1359f22ae92654e177dea552324c91c
12:27:27 AM: Fetching cached dependencies
12:27:27 AM: Failed to fetch cache, continuing with build
12:27:27 AM: Starting to prepare the repo for build
12:27:27 AM: No cached dependencies found. Cloning fresh repo
12:27:27 AM: git clone GitHub - yngwiewylde/ethereum-nft-marketplace-boilerplate: OpenClone
12:27:28 AM: Preparing Git Reference refs/heads/main
12:27:29 AM: Parsing package.json dependencies
12:27:30 AM: Starting build script
12:27:30 AM: Installing dependencies
12:27:30 AM: Python version set to 2.7
12:27:31 AM: v16.15.1 is already installed.
12:27:32 AM: Now using node v16.15.1 (npm v8.11.0)
12:27:32 AM: Started restoring cached build plugins
12:27:32 AM: Finished restoring cached build plugins
12:27:32 AM: Attempting ruby version 2.7.2, read from environment
12:27:33 AM: Using ruby version 2.7.2
12:27:34 AM: Using PHP version 8.0
12:27:34 AM: Started restoring cached yarn cache
12:27:34 AM: Finished restoring cached yarn cache
12:27:35 AM: No yarn workspaces detected
12:27:35 AM: Started restoring cached node modules
12:27:35 AM: Finished restoring cached node modules
12:27:35 AM: Installing NPM modules using Yarn version 1.22.10
12:27:35 AM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
12:27:35 AM: npm WARN config location in the cache, and they are managed by
12:27:35 AM: npm WARN config [cacache].
12:27:36 AM: yarn install v1.22.10
12:27:36 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
12:27:36 AM: [1/4] Resolving packages…
12:27:37 AM: [2/4] Fetching packages…
12:28:46 AM: [4/4] Building fresh packages…
12:28:53 AM: Done in 76.94s.
12:28:53 AM: NPM modules installed using Yarn
12:28:53 AM: Started restoring cached go cache
12:28:53 AM: Finished restoring cached go cache
12:28:53 AM: Installing Go version 1.17 (requested 1.17)
12:29:00 AM: unset GOOS;
12:29:00 AM: unset GOARCH;
12:29:00 AM: export GOROOT=β€˜/opt/buildhome/.gimme/versions/go1.17.linux.amd64’;
12:29:00 AM: export PATH=β€œ/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}”;
12:29:00 AM: go version >&2;
12:29:00 AM: export GIMME_ENV=β€œ/opt/buildhome/.gimme/env/go1.17.linux.amd64.env”
12:29:00 AM: go version go1.17 linux/amd64
12:29:00 AM: Installing missing commands
12:29:00 AM: Verify run directory
12:29:02 AM: ​
12:29:02 AM: ────────────────────────────────────────────────────────────────
12:29:02 AM: Netlify Build
12:29:02 AM: ────────────────────────────────────────────────────────────────
12:29:02 AM: ​
12:29:02 AM: ❯ Version
12:29:02 AM: @netlify/build 27.3.1
12:29:02 AM: ​
12:29:02 AM: ❯ Flags
12:29:02 AM: baseRelDir: true
12:29:02 AM: buildId: 62c1c36db640962a6a107882
12:29:02 AM: deployId: 62c1c36db640962a6a107884
12:29:02 AM: ​
12:29:02 AM: ❯ Current directory
12:29:02 AM: /opt/build/repo
12:29:02 AM: ​
12:29:02 AM: ❯ Config file
12:29:02 AM: No config file was defined: using default values.
12:29:02 AM: ​
12:29:02 AM: ❯ Context
12:29:02 AM: production
12:29:02 AM: ​
12:29:02 AM: ────────────────────────────────────────────────────────────────
12:29:02 AM: 1. Build command from Netlify app
12:29:02 AM: ────────────────────────────────────────────────────────────────
12:29:02 AM: ​
12:29:02 AM: $ yarn build
12:29:03 AM: yarn run v1.22.17
12:29:03 AM: $ react-scripts build
12:29:05 AM: Creating an optimized production build…
12:29:06 AM: Browserslist: caniuse-lite is outdated. Please run:
12:29:06 AM: npx browserslist@latest --update-db
12:29:06 AM:
12:31:56 AM:
12:31:56 AM: Treating warnings as errors because process.env.CI = true.
12:31:56 AM: Most CI servers set it automatically.
12:31:56 AM:
12:31:56 AM: Failed to compile.
12:31:56 AM:
12:31:56 AM: src/components/Chains/Chains.jsx
12:31:56 AM: Line 6:10: β€˜AvaxLogo’ is defined but never used no-unused-vars
12:31:56 AM: Line 6:33: β€˜BSCLogo’ is defined but never used no-unused-vars
12:31:56 AM: src/components/NFTBalance.jsx
12:31:56 AM: Line 230:11: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
12:31:56 AM: src/components/NFTMarketTransactions.jsx
12:31:56 AM: Line 1:17: β€˜useState’ is defined but never used no-unused-vars
12:31:56 AM: Line 17:11: β€˜Moralis’ is assigned a value but never used no-unused-vars
12:31:56 AM: Line 78:11: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
12:31:56 AM: Line 154:7: β€˜columns’ is assigned a value but never used no-unused-vars
12:31:56 AM: src/components/NFTTokenIds.jsx
12:31:56 AM: Line 1:27: β€˜useEffect’ is defined but never used no-unused-vars
12:31:56 AM: Line 7:3: β€˜useNewMoralisObject’ is defined but never used no-unused-vars
12:31:56 AM: Line 307:19: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
12:31:56 AM: Line 326:13: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
12:31:56 AM: src/hooks/useNFTBalance.js
12:31:56 AM: Line 19:13: Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
12:31:56 AM: useEffect(() => {
12:31:56 AM: async function fetchData() {
12:31:56 AM: // You can await here
12:31:56 AM: const response = await MyAPI.getData(someId);
12:31:56 AM: // …
12:31:56 AM: }
12:31:56 AM: fetchData();
12:31:56 AM: }, [someId]); // Or if effect doesn’t need props or state
12:31:56 AM:
12:31:56 AM: src/hooks/useNFTTokenIds.js
12:31:56 AM: Line 1:10: β€˜ContactsOutlined’ is defined but never used no-unused-vars
12:31:56 AM: Line 25:13: Effect callbacks are synchronous to prevent race conditions. Put the async function inside:
12:31:56 AM: useEffect(() => {
12:31:56 AM: async function fetchData() {
12:31:56 AM: // You can await here
12:31:56 AM: const response = await MyAPI.getData(someId);
12:31:56 AM: // …
12:31:56 AM: }
12:31:56 AM: fetchData();
12:31:56 AM: }, [someId]); // Or if effect doesn’t need props or state
12:31:56 AM:
12:31:56 AM: Line 65:6: React Hook useEffect has a missing dependency: β€˜resolveLink’. Either include it or remove the dependency array react-hooks/exhaustive-deps
12:31:56 AM: error Command failed with exit code 1. (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
12:31:56 AM: info Visit yarn run | Yarn for documentation about this command.
12:31:56 AM: ​
12:31:56 AM: ────────────────────────────────────────────────────────────────
12:31:56 AM: β€œbuild.command” failed
12:31:56 AM: ────────────────────────────────────────────────────────────────
12:31:56 AM: ​
12:31:56 AM: Error message
12:31:56 AM: Command failed with exit code 1: yarn build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
12:31:56 AM: ​
12:31:56 AM: Error location
12:31:56 AM: In Build command from Netlify app:
12:31:56 AM: yarn build
12:31:56 AM: ​
12:31:56 AM: Resolved config
12:31:56 AM: build:
12:31:56 AM: command: yarn build
12:31:56 AM: commandOrigin: ui
12:31:56 AM: publish: /opt/build/repo/build
12:31:56 AM: publishOrigin: ui
12:31:57 AM: Caching artifacts
12:31:57 AM: Started saving node modules
12:31:57 AM: Finished saving node modules
12:31:57 AM: Started saving build plugins
12:31:57 AM: Finished saving build plugins
12:31:57 AM: Started saving yarn cache
12:32:06 AM: Finished saving yarn cache
12:32:06 AM: Started saving pip cache
12:32:06 AM: Finished saving pip cache
12:32:06 AM: Started saving emacs cask dependencies
12:32:06 AM: Finished saving emacs cask dependencies
12:32:06 AM: Started saving maven dependencies
12:32:06 AM: Finished saving maven dependencies
12:32:06 AM: Started saving boot dependencies
12:32:06 AM: Finished saving boot dependencies
12:32:06 AM: Started saving rust rustup cache
12:32:06 AM: Finished saving rust rustup cache
12:32:06 AM: Started saving go dependencies
12:32:06 AM: Finished saving go dependencies
12:32:08 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:32:08 AM: Creating deploy upload records
12:32:08 AM: Failing build: Failed to build site
12:32:08 AM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
12:32:08 AM: Finished processing build request in 4m40.953450943s

Try to change your build command to CI= yarn build.

I used the one you gave but it’s still the same as the previous error

Your site’s setup might be different. Please share your site name.