I am currently working on a React project set up with create-react-app, and everything operates smoothly on my local machine using npm start. However, I’m encountering issues when I attempt to deploy it to Vercel, as the build process fails.
I have already tried deleting the node_modules directory and executing npm install again, but the issue remains unresolved.
Here’s the error I’m seeing:
Build failed! Command "npm run build" exited with 1
Refer to deployment logs for further details
Below are the detailed logs from the deployment:
14:22:15.441 Fetching deployment files...
14:22:17.185 Successfully downloaded 28 files
14:22:19.352 Analysis of the source code completed
14:22:21.499 Setting up the build environment...
14:22:26.121 Build environment ready in 4622ms
14:22:30.361 Checking for cached builds...
14:22:31.447 No build cache found
14:22:32.825 Identified package.json
14:22:32.826 Installing npm packages...
14:23:08.702 > [email protected] postinstall /vercel/workspace/node_modules/babel-runtime/node_modules/core-js
14:23:08.702 > node -e "try{require('./postinstall')}catch(e){}"
14:23:08.814 > [email protected] postinstall /vercel/workspace/node_modules/core-js
14:23:08.814 > node -e "try{require('./postinstall')}catch(e){}"
14:23:08.893 > [email protected] postinstall /vercel/workspace/node_modules/core-js-pure
14:23:08.893 > node -e "try{require('./postinstall')}catch(e){}"
14:23:09.011 > [email protected] postinstall /vercel/workspace/node_modules/ejs
14:23:09.012 > node ./postinstall.js
14:23:11.392 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/webpack-dev-server/node_modules/fsevents):
14:23:11.392 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
14:23:11.401 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack-chokidar2/node_modules/fsevents):
14:23:11.401 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
14:23:11.412 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
14:23:11.412 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
14:23:11.420 Added 1985 packages from 812 contributors in 38.59s
14:23:12.766 137 packages are seeking funding
14:23:12.766 run `npm fund` for details
14:23:13.041 Executing "npm run build"
14:23:13.310 > [email protected] build /vercel/workspace
14:23:13.310 > react-scripts build
14:23:15.056 Creating an optimized production build...
14:23:33.758 Treating warnings as errors due to process.env.CI = true.
14:23:33.758 Most CI environments enable this automatically.
14:23:33.758 Compilation failed.
14:23:33.759 src/components/Timer.js
14:23:33.759 Line 21:6: React Hook useEffect is missing a dependency: 'props.onTimeout'. Include it or remove the dependency list react-hooks/exhaustive-deps
14:23:33.787 npm ERR! code ELIFECYCLE
14:23:33.788 npm ERR! errno 1
14:23:33.791 npm ERR! [email protected] build: `react-scripts build`
14:23:33.791 npm ERR! Exit status 1
14:23:33.793 npm ERR!
14:23:33.793 npm ERR! Build script for [email protected] failed.
14:23:33.793 npm ERR! This is unlikely to be an npm issue. More logs may be available above.
14:23:33.802 npm ERR! Complete log available at:
14:23:33.802 npm ERR! /vercel/.npm/_logs/2021-03-28T11_23_33_792Z-debug.log
14:23:33.816 Error: Command "npm run build" exited with 1