JAMstack-Crash-Course-Build-a-Fullstack-App-with-React-Serverless-and-FaunaDB
JAMstack-Crash-Course-Build-a-Fullstack-App-with-React-Serverless-and-FaunaDB copied to clipboard
Netlify Build Fail
Great tutorial all works except the netlify publish.
After failing a few times from my own, I forked directly from this repo and uploaded but still get errors. The only thing my own is the faunadb key.
I get the following output
10:34:55 PM: ┌───────────────────────────────────┐
10:34:55 PM: │ 1. Build command from Netlify app │
10:34:55 PM: └───────────────────────────────────┘
10:34:55 PM:
10:34:55 PM: $ npm run build
10:34:55 PM: > [email protected] build /opt/build/repo
10:34:55 PM: > react-scripts build
10:34:56 PM: Creating an optimized production build...
10:35:07 PM:
10:35:07 PM: Treating warnings as errors because process.env.CI = true.
10:35:07 PM: Most CI servers set it automatically.
10:35:07 PM:
10:35:07 PM: Failed to compile.
10:35:07 PM:
10:35:07 PM: ./src/components/LinkForm.js
10:35:07 PM: Line 18:19: 'res' is assigned a value but never used no-unused-vars
10:35:07 PM: npm ERR! code ELIFECYCLE
10:35:07 PM: npm ERR! errno 1
10:35:07 PM: npm ERR! [email protected] build: react-scripts build
10:35:07 PM: npm ERR! Exit status 1
10:35:07 PM: npm ERR!
10:35:07 PM: npm ERR! Failed at the [email protected] build script.
10:35:07 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:35:07 PM: npm ERR! A complete log of this run can be found in:
10:35:07 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-09-30T21_35_07_397Z-debug.log
10:35:07 PM:
10:35:07 PM: ┌─────────────────────────────┐
10:35:07 PM: │ "build.command" failed │
10:35:07 PM: └─────────────────────────────┘
10:35:07 PM:
10:35:07 PM: Error message
10:35:07 PM: Command failed with exit code 1: npm run build
10:35:07 PM:
10:35:07 PM: Error location
10:35:07 PM: In Build command from Netlify app:
10:35:07 PM: npm run build
10:35:07 PM:
10:35:07 PM: Resolved config
10:35:07 PM: build:
10:35:07 PM: command: npm run build
10:35:07 PM: commandOrigin: ui
10:35:07 PM: environment:
10:35:07 PM: - FAUNA_SECRET_KEY
10:35:07 PM: functions: /opt/build/repo/functions
10:35:07 PM: publish: /opt/build/repo/build
10:35:07 PM: redirects:
10:35:07 PM: - from: api/* status: 200 to: '.netlify/functions/:splat'Caching artifacts
10:35:07 PM: Started saving node modules
10:35:07 PM: Finished saving node modules
10:35:07 PM: Started saving build plugins
10:35:07 PM: Finished saving build plugins
10:35:07 PM: Started saving pip cache
10:35:07 PM: Finished saving pip cache
10:35:07 PM: Started saving emacs cask dependencies
10:35:07 PM: Finished saving emacs cask dependencies
10:35:07 PM: Started saving maven dependencies
10:35:07 PM: Finished saving maven dependencies
10:35:07 PM: Started saving boot dependencies
10:35:07 PM: Finished saving boot dependencies
10:35:07 PM: Started saving go dependencies
10:35:07 PM: Finished saving go dependencies
10:35:10 PM: Error running command: Build script returned non-zero exit code: 2
10:35:10 PM: Failing build: Failed to build site
10:35:10 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
10:35:10 PM: Finished processing build request in 53.270903359s
He actually talks about this in the last 2-3min of the video. Take a look.