Hi, I’m trying to deploy an app React app created with create-react-app. It keeps failing after it tries to run the build command.
See log below. It seems like it not able to find the .svg file even though it is there. Letter casing is correct and it works locally.
Anybody know why it is Failing even though it’s working locally. I’m on a MAC OS.
Thanks in advance for your help!
log script below:
8:29:36 PM: Verify run directory
8:29:37 PM:
8:29:37 PM: ┌─────────────────────────────┐
8:29:37 PM: │ Netlify Build │
8:29:37 PM: └─────────────────────────────┘
8:29:37 PM:
8:29:37 PM: ❯ Version
8:29:37 PM: @netlify/build 3.3.0
8:29:37 PM:
8:29:37 PM: ❯ Flags
8:29:37 PM: deployId: 5f4ef54fe99df01768fd70ff
8:29:37 PM: mode: buildbot
8:29:37 PM:
8:29:37 PM: ❯ Current directory
8:29:37 PM: /opt/build/repo
8:29:37 PM:
8:29:37 PM: ❯ Config file
8:29:37 PM: No config file was defined: using default values.
8:29:37 PM:
8:29:37 PM: ❯ Context
8:29:37 PM: production
8:29:37 PM:
8:29:37 PM: ┌───────────────────────────────────┐
8:29:37 PM: │ 1. Build command from Netlify app │
8:29:37 PM: └───────────────────────────────────┘
8:29:37 PM:
8:29:37 PM: $ npm run build
8:29:37 PM: > crwn-clothing@0.1.0 build /opt/build/repo
8:29:37 PM: > react-scripts build
8:29:39 PM: Creating an optimized production build…
8:29:45 PM: Failed to compile.
8:29:45 PM:
8:29:45 PM: ./src/components/header/header.component.jsx
8:29:45 PM: Cannot find file ‘…/…/assets/crown.svg’ in ‘./src/components/header’.
8:29:45 PM: npm ERR! code ELIFECYCLE
8:29:45 PM: npm ERR! errno 1
8:29:45 PM: npm ERR! crwn-clothing@0.1.0 build: react-scripts build
8:29:45 PM: npm ERR! Exit status 1
8:29:45 PM: npm ERR!
8:29:45 PM: npm ERR! Failed at the crwn-clothing@0.1.0 build script.
8:29:45 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
8:29:45 PM: npm ERR! A complete log of this run can be found in:
8:29:45 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-09-02T01_29_45_798Z-debug.log
8:29:45 PM:
8:29:45 PM: 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:
8:29:45 PM: - Fix the issues highlighted by the warnings above.
8:29:45 PM: - Or modify the “scripts.build” command in your “package.json” from “react-scripts build” to “CI= react-scripts build”
8:29:45 PM: More information can be found at Build troubleshooting tips | Netlify Docs
8:29:45 PM:
8:29:45 PM: ┌─────────────────────────────┐
8:29:45 PM: │ “build.command” failed │
8:29:45 PM: └─────────────────────────────┘
8:29:45 PM:
8:29:45 PM: Error message
8:29:45 PM: Command failed with exit code 1: npm run build
8:29:45 PM:
8:29:45 PM: Error location
8:29:45 PM: In Build command from Netlify app:
8:29:45 PM: npm run build
8:29:45 PM:
8:29:45 PM: Resolved config
8:29:45 PM: build:
8:29:45 PM: command: npm run build
8:29:45 PM: commandOrigin: ui
8:29:45 PM: publish: /opt/build/repo/dist