Failed to build in create-react-app

6:08:42 PM: build-image version: a2d22d22e4555d1ef0a972ed14a0a4b366ad20c4 (focal)
6:08:42 PM: build-image tag: v4.16.3
6:08:42 PM: buildbot version: 75e84f11fc3a074e4b1dbecf215997511c028d25
6:08:42 PM: Fetching cached dependencies
6:08:43 PM: Failed to fetch cache, continuing with build
6:08:43 PM: Starting to prepare the repo for build
6:08:43 PM: No cached dependencies found. Cloning fresh repo
6:08:43 PM: git clone --filter=blob:none GitHub - pipicoker/music-app
6:08:43 PM: Preparing Git Reference refs/heads/master
6:08:43 PM: Parsing package.json dependencies
6:08:45 PM: Starting build script
6:08:45 PM: Installing dependencies
6:08:45 PM: Python version set to 2.7
6:08:45 PM: v16.19.0 is already installed.
6:08:46 PM: Now using node v16.19.0 (npm v8.19.3)
6:08:46 PM: Enabling Node.js Corepack
6:08:46 PM: Started restoring cached build plugins
6:08:46 PM: Finished restoring cached build plugins
6:08:46 PM: Attempting Ruby version 2.7.2, read from environment
6:08:46 PM: Using Ruby version 2.7.2
6:08:47 PM: Using PHP version 8.0
6:08:47 PM: Started restoring cached corepack dependencies
6:08:47 PM: mv: cannot move ‘/opt/build/cache/.node/corepack’ to ‘/opt/buildhome/.node/corepack’: No such file or directory
6:08:47 PM: Finished restoring cached corepack dependencies
6:08:47 PM: No npm workspaces detected
6:08:47 PM: Started restoring cached node modules
6:08:47 PM: Finished restoring cached node modules
6:08:47 PM: Bypassing sha validation. Running pre & post install scripts
6:08:47 PM: Installing npm packages using npm version 8.19.3
6:08:51 PM: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: Array.prototype.sort() - JavaScript | MDN
6:08:53 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
6:09:00 PM: added 1454 packages, and audited 1455 packages in 13s
6:09:00 PM: 212 packages are looking for funding
6:09:00 PM: run npm fund for details
6:09:00 PM: 24 vulnerabilities (14 low, 9 high, 1 critical)
6:09:00 PM: To address issues that do not require attention, run:
6:09:00 PM: npm audit fix
6:09:00 PM: To address all issues (including breaking changes), run:
6:09:00 PM: npm audit fix --force
6:09:00 PM: Run npm audit for details.
6:09:00 PM: npm packages installed
6:09:00 PM: Started restoring cached go cache
6:09:00 PM: Finished restoring cached go cache
6:09:00 PM: go version go1.19.4 linux/amd64
6:09:00 PM: Detected 1 framework(s)
6:09:00 PM: “create-react-app” at version “5.0.1”
6:09:00 PM: Installing missing commands
6:09:00 PM: Verify run directory
6:09:00 PM: Section completed: initializing
6:09:02 PM: ​
6:09:02 PM: Netlify Build
6:09:02 PM: ────────────────────────────────────────────────────────────────
6:09:02 PM: ​
6:09:02 PM: ❯ Version
6:09:02 PM: @netlify/build 29.4.3
6:09:02 PM: ​
6:09:02 PM: ❯ Flags
6:09:02 PM: baseRelDir: true
6:09:02 PM: buildId: 63beed1008e2a702a2ade8d4
6:09:02 PM: deployId: 63beed1008e2a702a2ade8d6
6:09:02 PM: ​
6:09:02 PM: ❯ Current directory
6:09:02 PM: /opt/build/repo
6:09:02 PM: ​
6:09:02 PM: ❯ Config file
6:09:02 PM: No config file was defined: using default values.
6:09:02 PM: ​
6:09:02 PM: ❯ Context
6:09:02 PM: production
6:09:02 PM: ​
6:09:02 PM: 1. Build command from Netlify app
6:09:02 PM: ────────────────────────────────────────────────────────────────
6:09:02 PM: ​
6:09:02 PM: $ npm run build
6:09:02 PM: > music@0.1.0 build
6:09:02 PM: > react-scripts build
6:09:03 PM: Creating an optimized production build…
6:09:05 PM: Failed to compile.
6:09:05 PM:
6:09:05 PM: Module not found: Error: Can’t resolve ‘./Likes_Coll_Btns’ in ‘/opt/build/repo/src/components’
6:09:05 PM: ​
6:09:05 PM: “build.command” failed
6:09:05 PM: ────────────────────────────────────────────────────────────────
6:09:05 PM: ​
6:09:05 PM: Error message
6:09:05 PM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
6:09:05 PM: ​
6:09:05 PM: Error location
6:09:05 PM: In Build command from Netlify app:
6:09:05 PM: npm run build
6:09:05 PM: ​
6:09:05 PM: Resolved config
6:09:05 PM: build:
6:09:05 PM: command: npm run build
6:09:05 PM: commandOrigin: ui
6:09:05 PM: publish: /opt/build/repo/build
6:09:05 PM: publishOrigin: ui
6:09:05 PM: Caching artifacts
6:09:05 PM: Started saving node modules
6:09:05 PM: Finished saving node modules
6:09:05 PM: Started saving build plugins
6:09:05 PM: Finished saving build plugins
6:09:05 PM: Started saving pip cache
6:09:05 PM: Finished saving pip cache
6:09:05 PM: Started saving emacs cask dependencies
6:09:05 PM: Finished saving emacs cask dependencies
6:09:05 PM: Started saving maven dependencies
6:09:05 PM: Finished saving maven dependencies
6:09:05 PM: Started saving boot dependencies
6:09:05 PM: Finished saving boot dependencies
6:09:05 PM: Started saving rust rustup cache
6:09:05 PM: Finished saving rust rustup cache
6:09:05 PM: Started saving go dependencies
6:09:05 PM: Finished saving go dependencies
6:09:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:09:07 PM: Failing build: Failed to build site
6:09:07 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
6:09:07 PM: Finished processing build request in 24.438977311s

Hi @pipicoker :wave:t6:, Welcome to the forums!

Have you tried the following:

Specify the base directory in netlify settings. Go to Settings → Build and Deploy → Edit Settings and fill it with client.

Or you can create netlify.toml in project directory with following configuration

[build]
  # Directory to change to before starting a build.
  # This is where we will look for package.json/.nvmrc/etc.
  # If not set, defaults to the root directory.
  base = "client"

7:54:15 AM: build-image version: a2d22d22e4555d1ef0a972ed14a0a4b366ad20c4 (focal)

7:54:15 AM: build-image tag: v4.16.3

7:54:15 AM: buildbot version: 9a6b4d0d37eb2a90e2c482e1d6cfe9a0793e6262

7:54:15 AM: Building without cache

7:54:15 AM: Starting to prepare the repo for build

7:54:15 AM: No cached dependencies found. Cloning fresh repo

7:54:15 AM: git clone --filter=blob:none GitHub - pipicoker/music-app

7:54:16 AM: Preparing Git Reference refs/heads/master

7:54:16 AM: Parsing package.json dependencies

7:54:17 AM: Failing build: Failed to parse configuration

7:54:17 AM: Failed during stage ‘Reading and parsing configuration files’:
When resolving config:
Base directory does not exist: /opt/build/repo/client

: exit status 1

7:54:17 AM: Finished processing build request in 2.088953542s

Hi @pipicoker,

Thanks for the follow-up.

I’m showing the latest build here:

With the error:

Module not found: Error: Can't resolve './Likes_Coll_Btns' in '/opt/build/repo/src/components'

This appears to be a case sensitivity issue.

From your Github:

The file is named Likes_coll_btns but it’s looking for Likes_Coll_Btns.

Could you see if you can find any references in your code with the capital letters and try lowercasing them?

Yes that was the problem, I found it and the problem has been solved. The site is live now, thank you

Hi @pipicoker :wave:t6: ,

Thanks for coming back and letting us know you resolved the issue. We appreciate the feedback.