Errror build reactjs app

4:54:12 PM: Build ready to start
4:54:14 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
4:54:14 PM: build-image tag: v3.4.1
4:54:14 PM: buildbot version: 9c8ae11ff96d61099561d579a91d03dc24930de5
4:54:14 PM: Building without cache
4:54:14 PM: Starting to prepare the repo for build
4:54:15 PM: No cached dependencies found. Cloning fresh repo
4:54:15 PM: git clone GitHub - junior-isabel/webchat-reactjs: criação de chat web com socket.io
4:54:15 PM: Preparing Git Reference refs/heads/master
4:54:17 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
4:54:17 PM: Starting build script
4:54:17 PM: Installing dependencies
4:54:17 PM: Python version set to 2.7
4:54:19 PM: Downloading and installing node v10.23.0…
4:54:19 PM: Downloading https://nodejs.org/dist/v10.23.0/node-v10.23.0-linux-x64.tar.xz
4:54:19 PM: Computing checksum with sha256sum
4:54:19 PM: Checksums matched!
4:54:22 PM: Now using node v10.23.0 (npm v6.14.8)
4:54:22 PM: Started restoring cached build plugins
4:54:22 PM: Finished restoring cached build plugins
4:54:23 PM: Attempting ruby version 2.6.2, read from environment
4:54:24 PM: Using ruby version 2.6.2
4:54:25 PM: Using PHP version 5.6
4:54:25 PM: 5.2 is already installed.
4:54:25 PM: Using Swift version 5.2
4:54:25 PM: Started restoring cached node modules
4:54:25 PM: Finished restoring cached node modules
4:54:25 PM: Started restoring cached yarn cache
4:54:25 PM: Finished restoring cached yarn cache
4:54:25 PM: Installing yarn at version 1.17.0
4:54:25 PM: Installing Yarn!
4:54:25 PM: > Downloading tarball…
4:54:25 PM: [1/2]: https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz → /tmp/yarn.tar.gz.xPHnRwVILD
4:54:25 PM: % Total % Received % Xferd Average Speed Time Time Time Current
4:54:25 PM: Dload Upload Total Spent Left Speed
4:54:25 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
4:54:25 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
4:54:25 PM: 100 80 100 80 0 0 232 0 --:–:-- --:–:-- --:–:-- 232
4:54:26 PM: 100 93 100 93 0 0 138 0 --:–:-- --:–:-- --:–:-- 138
4:54:26 PM: 100 643 100 643 0 0 680 0 --:–:-- --:–:-- --:–:-- 680
4:54:26 PM: 0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0
4:54:26 PM: 100 1213k 100 1213k 0 0 856k 0 0:00:01 0:00:01 --:–:-- 3901k
4:54:26 PM: [2/2]: https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz.asc → /tmp/yarn.tar.gz.xPHnRwVILD.asc
4:54:26 PM: 100 84 100 84 0 0 3048 0 --:–:-- --:–:-- --:–:-- 3048
4:54:26 PM: 100 97 100 97 0 0 1766 0 --:–:-- --:–:-- --:–:-- 1766
4:54:26 PM: 100 647 100 647 0 0 7533 0 --:–:-- --:–:-- --:–:-- 7533
4:54:27 PM: 100 832 100 832 0 0 4989 0 --:–:-- --:–:-- --:–:-- 4989
4:54:27 PM: > Verifying integrity…
4:54:27 PM: gpg: Signature made Fri 14 Jun 2019 06:55:58 PM UTC using RSA key ID 69475BAA
4:54:27 PM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
4:54:27 PM: gpg: WARNING: This key is not certified with a trusted signature!
4:54:27 PM: gpg: There is no indication that the signature belongs to the owner.
4:54:27 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
4:54:27 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
4:54:27 PM: > GPG signature looks good
4:54:27 PM: > Extracting to ~/.yarn…
4:54:27 PM: > Adding to $PATH…
4:54:27 PM: > Successfully installed Yarn 1.17.0! Please open another terminal where the yarn command will now be available.
4:54:28 PM: Installing NPM modules using Yarn version 1.17.0
4:54:29 PM: yarn install v1.17.0
4:54:29 PM: [1/4] Resolving packages…
4:54:30 PM: [2/4] Fetching packages…
4:55:05 PM: info fsevents@2.1.2: The platform “linux” is incompatible with this module.
4:55:05 PM: info “fsevents@2.1.2” is an optional dependency and failed compatibility check. Excluding it from installation.
4:55:05 PM: info fsevents@1.2.13: The platform “linux” is incompatible with this module.
4:55:05 PM: info “fsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
4:55:05 PM: info fsevents@2.1.3: The platform “linux” is incompatible with this module.
4:55:05 PM: info “fsevents@2.1.3” is an optional dependency and failed compatibility check. Excluding it from installation.
4:55:05 PM: [3/4] Linking dependencies…
4:55:05 PM: warning " > @testing-library/user-event@7.2.1" has unmet peer dependency “@testing-library/dom@>=5”.
4:55:05 PM: warning “react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1” has unmet peer dependency “typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta”.
4:55:25 PM: [4/4] Building fresh packages…
4:55:28 PM: Done in 59.57s.
4:55:28 PM: NPM modules installed using Yarn
4:55:29 PM: Started restoring cached go cache
4:55:29 PM: Finished restoring cached go cache
4:55:29 PM: Installing Go version 1.12
4:55:35 PM: unset GOOS;
4:55:35 PM: unset GOARCH;
4:55:35 PM: export GOROOT=‘/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
4:55:35 PM: export PATH=“/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}”;
4:55:35 PM: go version >&2;
4:55:35 PM: export GIMME_ENV=“/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env”
4:55:35 PM: go version go1.12 linux/amd64
4:55:35 PM: Installing missing commands
4:55:35 PM: Verify run directory
4:55:36 PM: ​
4:55:36 PM: ┌─────────────────────────────┐
4:55:36 PM: │ Netlify Build │
4:55:36 PM: └─────────────────────────────┘
4:55:36 PM: ​
4:55:36 PM: ❯ Version
4:55:36 PM: @netlify/build 5.2.1
4:55:36 PM: ​
4:55:36 PM: ❯ Flags
4:55:36 PM: deployId: 5fa2dcb471b3af20418d4a0d
4:55:36 PM: mode: buildbot
4:55:36 PM: ​
4:55:36 PM: ❯ Current directory
4:55:36 PM: /opt/build/repo
4:55:36 PM: ​
4:55:36 PM: ❯ Config file
4:55:36 PM: /opt/build/repo/netlify.toml
4:55:36 PM: ​
4:55:36 PM: ❯ Context
4:55:36 PM: production
4:55:36 PM: ​
4:55:36 PM: ┌───────────────────────────────────┐
4:55:36 PM: │ 1. Build command from Netlify app │
4:55:36 PM: └───────────────────────────────────┘
4:55:36 PM: ​
4:55:36 PM: $ yarn build
4:55:36 PM: yarn run v1.17.0
4:55:36 PM: $ react-scripts build
4:55:38 PM: Creating an optimized production build…
4:56:55 PM:
4:56:55 PM: Treating warnings as errors because process.env.CI = true.
4:56:55 PM: Most CI servers set it automatically.
4:56:55 PM:
4:56:55 PM: Failed to compile.
4:56:55 PM:
4:56:55 PM: ./src/App.js
4:56:55 PM: Line 39:6: React Hook useEffect has missing dependencies: ‘dispatch’ and ‘token’. Either include them or remove the dependency array react-hooks/exhaustive-deps
4:56:55 PM: Line 51:6: React Hook useEffect has a missing dependency: ‘dispatch’. Either include it or remove the dependency array react-hooks/exhaustive-deps
4:56:55 PM: Line 72:6: React Hook useEffect has a missing dependency: ‘dispatch’. Either include it or remove the dependency array react-hooks/exhaustive-deps
4:56:55 PM: Line 87:6: React Hook useEffect has a missing dependency: ‘dispatch’. Either include it or remove the dependency array react-hooks/exhaustive-deps
4:56:55 PM: ./src/components/callModal/call.js
4:56:55 PM: Line 46:6: React Hook useEffect has a missing dependency: ‘dispatch’. Either include it or remove the dependency array react-hooks/exhaustive-deps
4:56:55 PM: Line 54:6: React Hook useEffect has missing dependencies: ‘acceptCall’, ‘callUser’, and ‘statusCall.status’. Either include them or remove the dependency array react-hooks/exhaustive-deps
4:56:55 PM: Line 62:6: React Hook useEffect has missing dependencies: ‘dispatch’ and ‘socket’. Either include them or remove the dependency array react-hooks/exhaustive-deps
4:56:55 PM: ./src/pages/private/home/home.js
4:56:55 PM: Line 71:6: React Hook useEffect has a missing dependency: ‘messages’. Either include it or remove the dependency array react-hooks/exhaustive-deps
4:56:55 PM: error Command failed with exit code 1.
4:56:55 PM: info Visit yarn run | Yarn for documentation about this command.
4:56:55 PM: ​
4:56:55 PM: ┌─────────────────────────────┐
4:56:55 PM: │ “build.command” failed │
4:56:55 PM: └─────────────────────────────┘
4:56:55 PM: ​
4:56:55 PM: Error message
4:56:55 PM: Command failed with exit code 1: yarn build
4:56:55 PM: ​
4:56:55 PM: Error location
4:56:55 PM: In Build command from Netlify app:
4:56:55 PM: yarn build
4:56:55 PM: ​
4:56:55 PM: Resolved config
4:56:55 PM: build:
4:56:55 PM: command: yarn build
4:56:55 PM: commandOrigin: ui
4:56:55 PM: environment:
4:56:55 PM: - REACT_APP_URL
4:56:55 PM: publish: /opt/build/repo/build
4:56:56 PM: Caching artifacts
4:56:56 PM: Started saving node modules
4:56:56 PM: Finished saving node modules
4:56:56 PM: Started saving build plugins
4:56:56 PM: Finished saving build plugins
4:56:56 PM: Started saving yarn cache
4:56:56 PM: Finished saving yarn cache
4:56:56 PM: Started saving pip cache
4:56:56 PM: Finished saving pip cache
4:56:56 PM: Started saving emacs cask dependencies
4:56:56 PM: Finished saving emacs cask dependencies
4:56:56 PM: Started saving maven dependencies
4:56:56 PM: Finished saving maven dependencies
4:56:56 PM: Started saving boot dependencies
4:56:56 PM: Finished saving boot dependencies
4:56:56 PM: Started saving go dependencies
4:56:58 PM: Finished saving go dependencies
4:57:02 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:57:02 PM: Failing build: Failed to build site
4:57:02 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
4:57:02 PM: Finished processing build request in 2m47.719287183s

Hi, there’s a big discussion regarding this n React’s Github repository. Check here: https://github.com/facebook/react/issues/15865

1 Like

solution is “build”: “CI= react-scripts build” in package.json