Continuous deployment of a react app on netlify rendering blank page - node.js

I just finished a continuous deployment from Github on netlify. With these setting:
Build Command: npm build
Publish Directory: devit/public/
It deployed without any errors, on visiting the site it was blank.
Complete Deploy log :
4:10:30 AM: Build ready to start
4:10:32 AM: build-image version: ca811f47d4c1cbd1812d1eb6ecb0c977e86d1a1d
4:10:32 AM: build-image tag: v3.3.20
4:10:32 AM: buildbot version: 78b5536ab4f742c26705d3e953381b9cde6e22ef
4:10:32 AM: Fetching cached dependencies
4:10:32 AM: Starting to download cache of 88.5MB
4:10:33 AM: Finished downloading cache in 724.248229ms
4:10:33 AM: Starting to extract cache
4:10:35 AM: Finished extracting cache in 2.554192297s
4:10:35 AM: Finished fetching cache in 3.297079366s
4:10:35 AM: Starting to prepare the repo for build
4:10:36 AM: Preparing Git Reference refs/heads/master
4:10:37 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'devit/public' versus 'devit/public/' in the Netlify UI
4:10:37 AM: Starting build script
4:10:37 AM: Installing dependencies
4:10:37 AM: Python version set to 2.7
4:10:38 AM: Started restoring cached node version
4:10:40 AM: Finished restoring cached node version
4:10:41 AM: v12.18.0 is already installed.
4:10:41 AM: Now using node v12.18.0 (npm v6.14.4)
4:10:41 AM: Started restoring cached build plugins
4:10:41 AM: Finished restoring cached build plugins
4:10:41 AM: Attempting ruby version 2.7.1, read from environment
4:10:42 AM: Using ruby version 2.7.1
4:10:43 AM: Using PHP version 5.6
4:10:43 AM: 5.2 is already installed.
4:10:43 AM: Using Swift version 5.2
4:10:43 AM: Started restoring cached go cache
4:10:43 AM: Finished restoring cached go cache
4:10:43 AM: go version go1.14.4 linux/amd64
4:10:43 AM: go version go1.14.4 linux/amd64
4:10:43 AM: Installing missing commands
4:10:43 AM: Verify run directory
4:10:44 AM: ​
4:10:44 AM: ┌─────────────────────────────┐
4:10:44 AM: │ Netlify Build │
4:10:44 AM: └─────────────────────────────┘
4:10:44 AM: ​
4:10:44 AM: ❯ Version
4:10:44 AM: #netlify/build 2.0.27
4:10:44 AM: ​
4:10:44 AM: ❯ Flags
4:10:44 AM: deployId: 5f0547367d92cb55b46de080
4:10:44 AM: mode: buildbot
4:10:44 AM: ​
4:10:44 AM: ❯ Current directory
4:10:44 AM: /opt/build/repo
4:10:44 AM: ​
4:10:44 AM: ❯ Config file
4:10:44 AM: No config file was defined: using default values.
4:10:44 AM: ​
4:10:44 AM: ❯ Context
4:10:44 AM: production
4:10:44 AM: ​
4:10:44 AM: ┌───────────────────────────────────┐
4:10:44 AM: │ 1. Build command from Netlify app │
4:10:44 AM: └───────────────────────────────────┘
4:10:44 AM: ​
4:10:44 AM: $ npm build
4:10:44 AM: ​
4:10:44 AM: (build.command completed in 274ms)
4:10:44 AM: ​
4:10:44 AM: ┌─────────────────────────────┐
4:10:44 AM: │ Netlify Build Complete │
4:10:44 AM: └─────────────────────────────┘
4:10:44 AM: ​
4:10:44 AM: (Netlify Build completed in 298ms)
4:10:44 AM: Caching artifacts
4:10:44 AM: Started saving build plugins
4:10:44 AM: Finished saving build plugins
4:10:44 AM: Started saving pip cache
4:10:44 AM: Finished saving pip cache
4:10:44 AM: Started saving emacs cask dependencies
4:10:44 AM: Finished saving emacs cask dependencies
4:10:44 AM: Started saving maven dependencies
4:10:44 AM: Finished saving maven dependencies
4:10:44 AM: Started saving boot dependencies
4:10:44 AM: Finished saving boot dependencies
4:10:44 AM: Started saving go dependencies
4:10:44 AM: Finished saving go dependencies
4:10:44 AM: Build script success
4:10:44 AM: Starting to deploy site from 'devit/public'
4:10:44 AM: Creating deploy tree
4:10:45 AM: Creating deploy upload records
4:10:45 AM: 0 new files to upload
4:10:45 AM: 0 new functions to upload
4:10:45 AM: Starting post processing
4:10:45 AM: Post processing - HTML
4:10:46 AM: Post processing - redirect rules
4:10:46 AM: Post processing - header rules
4:10:46 AM: Post processing done
4:10:46 AM: Site is live
4:10:56 AM: Finished processing build request in 24.126985051s
I also checked the browser console, and found this:
https://i.stack.imgur.com/1nqt1.png
GitHub repository : https://github.com/kelvinyelyen/dev.it_blog

npm build does not run your build script, it builds an npm package, which doesn't do anything useful for a website. You'd also have to use the devit directory.
Setting the build command to npm run build --prefix devit should fix the issue.

Related

I am getting the following error: Deploy did not succeed: Deploy directory 'project_music_player-main/project_music_player-main' does not

11:20:32 AM: Configuration error
11:20:32 AM: ────────────────────────────────────────────────────────────────
11:20:32 AM: ​
11:20:32 AM: Error message
11:20:32 AM: Deploy did not succeed: Deploy directory 'project_music_player-main/project_music_player-main' does not exist
11:20:32 AM: ​
11:20:32 AM: Resolved config
11:20:32 AM: build:
11:20:32 AM: base: /opt/build/repo/project_music_player-main
11:20:32 AM: command: npm run build
11:20:32 AM: commandOrigin: ui
11:20:32 AM: publish: /opt/build/repo/project_music_player-main/project_music_player-main
11:20:32 AM: publishOrigin: ui

yarn command stopped working on netlify: "build.command" failed

I'm failing with the command build setup with yarn in Netlify, it was working normally until a while ago. I tried to change the build command to:
CI = yarn build,
CI = yarn run build
yarn build
yarn run build and others...
but i didn't succeed, i would like to know why this occurs and what other alternatives do i have to solve this problem? thanks for your attention.
deploy log:
────────────────────────────────────────────────────────────────
7:11:32 AM: "build.command" failed
7:11:32 AM: ────────────────────────────────────────────────────────────────
7:11:32 AM: ​
7:11:32 AM: Error message
7:11:32 AM: Command failed with exit code 127: CI = yarn build
7:11:32 AM: ​
7:11:32 AM: Error location
7:11:32 AM: In Build command from Netlify app:
7:11:32 AM: CI = yarn build
7:11:32 AM: ​
7:11:32 AM: Resolved config
7:11:32 AM: build:
7:11:32 AM: base: /opt/build/repo/frontend
7:11:32 AM: command: CI = yarn build
7:11:32 AM: commandOrigin: ui
7:11:32 AM: environment:
7:11:32 AM: - REACT_APP_BACKEND_URL
7:11:32 AM: - YARN_FLAGS
7:11:32 AM: publish: /opt/build/repo/frontend/build
7:11:32 AM: publishOrigin: ui
7:11:33 AM: Caching artifacts
7:11:33 AM: Started saving node modules
7:11:33 AM: Finished saving node modules
7:11:33 AM: Started saving build plugins
7:11:33 AM: Finished saving build plugins
7:11:33 AM: Started saving yarn cache
7:11:42 AM: Finished saving yarn cache
7:11:42 AM: Started saving pip cache
7:11:42 AM: Finished saving pip cache
7:11:42 AM: Started saving emacs cask dependencies
7:11:42 AM: Finished saving emacs cask dependencies
7:11:42 AM: Started saving maven dependencies
7:11:42 AM: Finished saving maven dependencies
7:11:42 AM: Started saving boot dependencies
7:11:42 AM: Finished saving boot dependencies
7:11:42 AM: Started saving rust rustup cache
7:11:42 AM: Finished saving rust rustup cache
7:11:42 AM: Started saving go dependencies
7:11:42 AM: Finished saving go dependencies
7:11:44 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:11:44 AM: Creating deploy upload records
7:11:45 AM: Failing build: Failed to build site
7:11:45 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
7:11:45 AM: Finished processing build request in 1m6.06516331s

I have problem with deploying Sanity studio on Netlify

it maybe silly questions to someone here but I have nowhere to ask so I came here.
I deployed my portfolio page with Sanity & Gatsby Starter.
It works okay → https://lovethis.one.
deploy status
The website is deployed perfectly but Studio keeps failing when I try to deploy.
On netlify it says it's failing because
$ npm run build-studio && cp studio/netlify.toml studio/dist
12:52:01 AM: > sanity-gatsby-portfolio#0.0.0 build-studio
12:52:01 AM: > (cd studio && npm run build)
12:52:01 AM: > sanity-gatsby-portfolio-studio#1.0.6 build
12:52:01 AM: > sanity build
12:52:01 AM: sh: 1: sanity: not found
12:52:01 AM: ​
12:52:01 AM: ────────────────────────────────────────────────────────────────
12:52:01 AM: "build.command" failed
12:52:01 AM: ────────────────────────────────────────────────────────────────
12:52:01 AM: ​
12:52:01 AM: Error message
12:52:01 AM: Command failed with exit code 127: npm run build-studio && cp studio/netlify.toml studio/dist
12:52:01 AM: ​
12:52:01 AM: Error location
12:52:01 AM: In Build command from Netlify app:
12:52:01 AM: npm run build-studio && cp studio/netlify.toml studio/dist
12:52:01 AM: ​
12:52:01 AM: Resolved config
12:52:01 AM: build:
12:52:01 AM: base: /opt/build/repo
12:52:01 AM: command: npm run build-studio && cp studio/netlify.toml studio/dist
12:52:01 AM: commandOrigin: ui
12:52:01 AM: environment:
12:52:01 AM: - INCOMING_HOOK_BODY
12:52:01 AM: - INCOMING_HOOK_TITLE
12:52:01 AM: - INCOMING_HOOK_URL
12:52:01 AM: publish: /opt/build/repo/studio/dist
12:52:01 AM: publishOrigin: ui
I am quite newbie here and hope I can find answer.
Also I am wondering why my studio shows the blank area like this.
blank area on dashboard
On the content side, it the name of the project is sample project I also wish to change.
sample project not project
Thank you in advance for your help!
If I broke any rules here, I will try to edit or fix the content.
Thank you for understanding.
It looks like the Sanity CLI isn't installed so when the script tries to run the sanity build command, it fails. Could you run npm install #sanity/cli (note—not globally) in your studio folder, then try pushing/deploying once again?

netlify build command failed (create react app)-locally deployed ok

I can't figure out why I can deploy perfectly locally but not working when I manually dropped the build folder online or add my repo with Github method. I got the error like below:
10:21:21 PM: Build ready to start 10:21:22 PM: build-image version:
d84c79427e8f83c1ba17bcdd7b3fe38059376b68 10:21:22 PM: build-image tag:
v3.6.1 10:21:22 PM: buildbot version:
44655717ddf0e7bd7f856f5b1154254de54b1d80 10:21:23 PM: Building without
cache 10:21:23 PM: Starting to prepare the repo for build 10:21:23 PM:
No cached dependencies found. Cloning fresh repo 10:21:23 PM: git
clone https://github.com/celinevalentine/Games 10:21:24 PM: Preparing
Git Reference refs/heads/celinev 10:21:26 PM: Different publish path
detected, going to use the one specified in the Netlify configuration
file: 'build' versus 'build/' in the Netlify UI 10:21:26 PM: Starting
build script 10:21:26 PM: Installing dependencies 10:21:26 PM: Python
version set to 2.7 10:21:27 PM: v12.18.0 is already installed.
10:21:28 PM: Now using node v12.18.0 (npm v6.14.4) 10:21:28 PM:
Started restoring cached build plugins 10:21:28 PM: Finished restoring
cached build plugins 10:21:28 PM: Attempting ruby version 2.7.1, read
from environment 10:21:29 PM: Using ruby version 2.7.1 10:21:29 PM:
Using PHP version 5.6 10:21:29 PM: Started restoring cached go cache
10:21:29 PM: Finished restoring cached go cache 10:21:29 PM: go
version go1.14.4 linux/amd64 10:21:29 PM: go version go1.14.4
linux/amd64 10:21:29 PM: Installing missing commands 10:21:29 PM:
Verify run directory 10:21:31 PM: ​ 10:21:31 PM:
────────────────────────────────────────────────────────────────
10:21:31 PM: Netlify Build
10:21:31 PM:
────────────────────────────────────────────────────────────────
10:21:31 PM: ​ 10:21:31 PM: ❯ Version 10:21:31 PM: #netlify/build
8.3.0 10:21:31 PM: ​ 10:21:31 PM: ❯ Flags 10:21:31 PM: deployId: 6014fae1970bcf9dcb4a28eb 10:21:31 PM: mode: buildbot 10:21:31 PM: ​
10:21:31 PM: ❯ Current directory 10:21:31 PM: /opt/build/repo
10:21:31 PM: ​ 10:21:31 PM: ❯ Config file 10:21:31 PM: No config
file was defined: using default values. 10:21:31 PM: ​ 10:21:31 PM: ❯
Context 10:21:31 PM: production 10:21:31 PM: ​ 10:21:31 PM:
────────────────────────────────────────────────────────────────
10:21:31 PM: 1. Build command from Netlify app
10:21:31 PM:
────────────────────────────────────────────────────────────────
10:21:31 PM: ​ 10:21:31 PM: $ npm run build 10:21:31 PM: npm ERR! code
ENOENT 10:21:31 PM: npm ERR! syscall open 10:21:31 PM: npm ERR! path
/opt/build/repo/package.json 10:21:31 PM: npm ERR! errno -2 10:21:31
PM: npm ERR! enoent ENOENT: no such file or directory, open
'/opt/build/repo/package.json' 10:21:31 PM: npm ERR! enoent This is
related to npm not being able to find a file. 10:21:31 PM: npm ERR!
enoent 10:21:31 PM: npm ERR! A complete log of this run can be found
in: 10:21:31 PM: npm ERR!
/opt/buildhome/.npm/_logs/2021-01-30T06_21_31_988Z-debug.log 10:21:32
PM: ​ 10:21:32 PM:
────────────────────────────────────────────────────────────────
10:21:32 PM: "build.command" failed
10:21:32 PM:
────────────────────────────────────────────────────────────────
10:21:32 PM: ​ 10:21:32 PM: Error message 10:21:32 PM: Command
failed with exit code 254: npm run build 10:21:32 PM: ​ 10:21:32 PM:
Error location 10:21:32 PM: In Build command from Netlify app:
10:21:32 PM: npm run build 10:21:32 PM: ​ 10:21:32 PM: Resolved
config 10:21:32 PM: build: 10:21:32 PM: command: npm run build
10:21:32 PM: commandOrigin: ui 10:21:32 PM: publish:
/opt/build/repo/build 10:21:32 PM: Caching artifacts 10:21:32 PM:
Started saving build plugins 10:21:32 PM: Finished saving build
plugins 10:21:32 PM: Started saving pip cache 10:21:32 PM: Finished
saving pip cache 10:21:32 PM: Started saving emacs cask dependencies
10:21:32 PM: Finished saving emacs cask dependencies 10:21:32 PM:
Started saving maven dependencies 10:21:32 PM: Finished saving maven
dependencies 10:21:32 PM: Started saving boot dependencies 10:21:32
PM: Finished saving boot dependencies 10:21:32 PM: Started saving rust
rustup cache 10:21:32 PM: Finished saving rust rustup cache 10:21:32
PM: Started saving go dependencies 10:21:32 PM: Finished saving go
dependencies 10:21:35 PM: Build failed due to a user error: Build
script returned non-zero exit code: 2 10:21:35 PM: Failing build:
Failed to build site 10:21:35 PM: Failed during stage 'building site':
Build script returned non-zero exit code: 2 10:21:35 PM: Finished
processing build request in 12.138963808s
Please try
CI= npm run build
instead of the
-> npm run build

Netlify issue on deployment

I have tried to edit what it says here but the result is the same, failed! can anyone know how to fix it?
I tried to edit the package.json
"build" : "CI= react-script build"
in netlify build command, I tried this both
CI= npm run build
and
npm run build
10:27:27 AM: Waiting for other deploys from your team to complete
10:27:55 AM: Build ready to start
10:27:58 AM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
10:27:58 AM: build-image tag: v3.4.1
10:27:58 AM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871
10:27:58 AM: Fetching cached dependencies
10:27:58 AM: Failed to fetch cache, continuing with build
10:27:58 AM: Starting to prepare the repo for build
10:27:59 AM: No cached dependencies found. Cloning fresh repo
10:27:59 AM: git clone https://github.com/djdalino/sampleKYC
10:27:59 AM: Preparing Git Reference refs/heads/master
10:28:01 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'client-side/build' versus 'build/' in the Netlify UI
10:28:01 AM: Starting build script
10:28:01 AM: Installing dependencies
10:28:01 AM: Python version set to 2.7
10:28:02 AM: v12.18.0 is already installed.
10:28:03 AM: Now using node v12.18.0 (npm v6.14.4)
10:28:03 AM: Started restoring cached build plugins
10:28:03 AM: Finished restoring cached build plugins
10:28:03 AM: Attempting ruby version 2.7.1, read from environment
10:28:05 AM: Using ruby version 2.7.1
10:28:06 AM: Using PHP version 5.6
10:28:06 AM: 5.2 is already installed.
10:28:06 AM: Using Swift version 5.2
10:28:06 AM: Started restoring cached node modules
10:28:06 AM: Finished restoring cached node modules
10:28:06 AM: Installing NPM modules using NPM version 6.14.4
10:28:42 AM: > core-js#2.6.11 postinstall /opt/build/repo/client-side/node_modules/babel-runtime/node_modules/core-js
10:28:42 AM: > node -e "try{require('./postinstall')}catch(e){}"
10:28:42 AM: > core-js#3.6.5 postinstall /opt/build/repo/client-side/node_modules/core-js
10:28:42 AM: > node -e "try{require('./postinstall')}catch(e){}"
10:28:42 AM: > core-js-pure#3.6.5 postinstall /opt/build/repo/client-side/node_modules/core-js-pure
10:28:42 AM: > node -e "try{require('./postinstall')}catch(e){}"
10:28:44 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
10:28:44 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
10:28:44 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
10:28:44 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
10:28:44 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules/jest-haste-map/node_modules/fsevents):
10:28:44 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
10:28:44 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.2 (node_modules/fsevents):
10:28:44 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
10:28:44 AM: added 1620 packages from 783 contributors and audited 1627 packages in 37.161s
10:28:46 AM: 66 packages are looking for funding
10:28:46 AM: run `npm fund` for details
10:28:46 AM: found 0 vulnerabilities
10:28:46 AM: NPM modules installed
10:28:46 AM: Started restoring cached go cache
10:28:46 AM: Finished restoring cached go cache
10:28:46 AM: go version go1.14.4 linux/amd64
10:28:46 AM: go version go1.14.4 linux/amd64
10:28:46 AM: Installing missing commands
10:28:46 AM: Verify run directory
10:28:47 AM: ​
10:28:47 AM: ┌─────────────────────────────┐
10:28:47 AM: │ Netlify Build │
10:28:47 AM: └─────────────────────────────┘
10:28:47 AM: ​
10:28:47 AM: ❯ Version
10:28:47 AM: #netlify/build 3.3.0
10:28:47 AM: ​
10:28:47 AM: ❯ Flags
10:28:47 AM: deployId: 5f45c88e8cca8d000888ec92
10:28:47 AM: mode: buildbot
10:28:47 AM: ​
10:28:47 AM: ❯ Current directory
10:28:47 AM: /opt/build/repo/client-side
10:28:47 AM: ​
10:28:47 AM: ❯ Config file
10:28:47 AM: No config file was defined: using default values.
10:28:47 AM: ​
10:28:47 AM: ❯ Context
10:28:47 AM: production
10:28:48 AM: ​
10:28:48 AM: ┌───────────────────────────────────┐
10:28:48 AM: │ 1. Build command from Netlify app │
10:28:48 AM: └───────────────────────────────────┘
10:28:48 AM: ​
10:28:48 AM: $ npm run build
10:28:48 AM: > client-side#0.1.0 build /opt/build/repo/client-side
10:28:48 AM: > react-scripts build
10:28:49 AM: Creating an optimized production build...
10:29:00 AM: Failed to compile.
10:29:00 AM:
10:29:00 AM: ./src/components/Step/StepTwo.jsx
10:29:00 AM: Line 14:5: 'setCount' is not defined no-undef
10:29:00 AM: Search for the keywords to learn more about each error.
10:29:00 AM: npm ERR! code ELIFECYCLE
10:29:00 AM: npm ERR! errno 1
10:29:00 AM: npm ERR! client-side#0.1.0 build: `react-scripts build`
10:29:00 AM: npm ERR! Exit status 1
10:29:00 AM: npm ERR!
10:29:00 AM: npm ERR! Failed at the client-side#0.1.0 build script.
10:29:00 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:29:00 AM: npm ERR! A complete log of this run can be found in:
10:29:00 AM: npm ERR! /opt/buildhome/.npm/_logs/2020-08-26T02_29_00_762Z-debug.log
10:29:00 AM:
10:29:00 AM: If the build failed with a warning about "process.env.CI = true", this is due to "create-react-app" treating warnings as errors when in CI. In order to fix this problem, please either:
10:29:00 AM: - Fix the issues highlighted by the warnings above.
10:29:00 AM: - Or modify the "scripts.build" command in your "package.json" from "react-scripts build" to "CI= react-scripts build"
10:29:00 AM: More information can be found at https://docs.netlify.com/configure-builds/troubleshooting-tips/#build-fails-on-warning-message
10:29:00 AM: ​
10:29:00 AM: ┌─────────────────────────────┐
10:29:00 AM: │ "build.command" failed │
10:29:00 AM: └─────────────────────────────┘
10:29:00 AM: ​
10:29:00 AM: Error message
10:29:00 AM: Command failed with exit code 1: npm run build
10:29:00 AM: ​
10:29:00 AM: Error location
10:29:00 AM: In Build command from Netlify app:
10:29:00 AM: npm run build
10:29:00 AM: ​
10:29:00 AM: Resolved config
10:29:00 AM: build:
10:29:00 AM: base: /opt/build/repo/client-side
10:29:00 AM: command: npm run build
10:29:00 AM: commandOrigin: ui
10:29:00 AM: publish: /opt/build/repo/client-side/build
10:29:00 AM: Caching artifacts
10:29:00 AM: Started saving node modules
10:29:00 AM: Finished saving node modules
10:29:00 AM: Started saving build plugins
10:29:00 AM: Finished saving build plugins
10:29:00 AM: Started saving pip cache
10:29:01 AM: Finished saving pip cache
10:29:01 AM: Started saving emacs cask dependencies
10:29:01 AM: Finished saving emacs cask dependencies
10:29:01 AM: Started saving maven dependencies
10:29:01 AM: Finished saving maven dependencies
10:29:01 AM: Started saving boot dependencies
10:29:01 AM: Finished saving boot dependencies
10:29:01 AM: Started saving go dependencies
10:29:01 AM: Finished saving go dependencies
10:29:03 AM: Error running command: Build script returned non-zero exit code: 1
10:29:03 AM: Failing build: Failed to build site
10:29:03 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
10:29:04 AM: Finished processing build request in 1m5.49317571s
I have tried to edit what it says here but the result is the same, failed! can anyone know how to fix it?
I tried to edit the package.json
"build" : "CI= react-script build"
in netlify build command, I tried this both
CI= npm run build
and
npm run build
The issue is with your actual code not with Netlify.
The error message you are getting is listed here:
10:28:48 AM: $ npm run build
10:28:48 AM: > client-side#0.1.0 build /opt/build/repo/client-side
10:28:48 AM: > react-scripts build
10:28:49 AM: Creating an optimized production build...
10:29:00 AM: Failed to compile.
10:29:00 AM:
10:29:00 AM: ./src/components/Step/StepTwo.jsx
10:29:00 AM: Line 14:5: 'setCount' is not defined no-undef
Once you fix that issue with setCount not being defined it should work just fine.

Resources