Deploy failed with error message Could not resolve "../assets/Logo.png"

site name: bespoke-bunny-e0bc92
repo: premier-roofing-co
build settings:
Runtime
Not set

Base directory
Not set

Build command
CI= yarn run build

Publish directory
dist

Deploy log visibility
Logs are public

Build status

Active

The only real debugging I’ve tried is changing the build command from from yarn build to the current one. I am new to deploying a site with vite & react so not sure where to go from here.

12:02:02 PM: build-image version: 900a223ea0f4a600c43255115089305a2b808649 (focal)
12:02:02 PM: buildbot version: 900a223ea0f4a600c43255115089305a2b808649
12:02:03 PM: Building without cache
12:02:03 PM: Starting to prepare the repo for build
12:02:03 PM: No cached dependencies found. Cloning fresh repo
12:02:03 PM: git clone --filter=blob:none https://github.com/rramirez216/premier-roofing-co
12:02:03 PM: Preparing Git Reference refs/heads/main
12:02:05 PM: Parsing package.json dependencies
12:02:07 PM: Starting to install dependencies
12:02:07 PM: Python version set to 3.8
12:02:07 PM: Attempting Ruby version 2.7.2, read from environment
12:02:07 PM: Using Ruby version 2.7.2
12:02:08 PM: Started restoring cached go cache
12:02:08 PM: Finished restoring cached go cache
12:02:08 PM: Installing Go version 1.19.5 (requested 1.19.5)
12:02:13 PM: go version go1.19.5 linux/amd64
12:02:14 PM: Using PHP version 8.0
12:02:14 PM: v16.20.0 is already installed.
12:02:15 PM: Now using node v16.20.0 (npm v8.19.4)
12:02:15 PM: Enabling Node.js Corepack
12:02:15 PM: Started restoring cached build plugins
12:02:15 PM: Finished restoring cached build plugins
12:02:15 PM: Started restoring cached corepack dependencies
12:02:15 PM: Finished restoring cached corepack dependencies
12:02:15 PM: Started restoring cached yarn cache
12:02:15 PM: Finished restoring cached yarn cache
12:02:15 PM: No yarn workspaces detected
12:02:15 PM: Started restoring cached node modules
12:02:15 PM: Finished restoring cached node modules
12:02:15 PM: Installing npm packages using Yarn version 1.22.19
12:02:16 PM: yarn install v1.22.19
12:02:16 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
12:02:16 PM: [1/4] Resolving packages...
12:02:16 PM: [2/4] Fetching packages...
12:02:20 PM: [3/4] Linking dependencies...
12:02:21 PM: [4/4] Building fresh packages...
12:02:21 PM: Done in 5.07s.
12:02:21 PM: npm packages installed using Yarn
12:02:21 PM: Install dependencies script success
12:02:21 PM: Starting build script
12:02:22 PM: Detected 1 framework(s)
12:02:22 PM: "vite" at version "4.1.1"
12:02:22 PM: Section completed: initializing
12:02:23 PM: ​
12:02:23 PM: Netlify Build                                                 
12:02:23 PM: ────────────────────────────────────────────────────────────────
12:02:23 PM: ​
12:02:23 PM: ❯ Version
12:02:23 PM:   @netlify/build 29.11.1
12:02:23 PM: ​
12:02:23 PM: ❯ Flags
12:02:23 PM:   baseRelDir: true
12:02:23 PM:   buildId: 645a9891efdf6f19e2436c29
12:02:23 PM:   deployId: 645a9891efdf6f19e2436c2b
12:02:23 PM: ​
12:02:23 PM: ❯ Current directory
12:02:23 PM:   /opt/build/repo
12:02:23 PM: ​
12:02:23 PM: ❯ Config file
12:02:23 PM:   No config file was defined: using default values.
12:02:23 PM: ​
12:02:23 PM: ❯ Context
12:02:23 PM:   production
12:02:23 PM: ​
12:02:23 PM: Build command from Netlify app                                
12:02:23 PM: ────────────────────────────────────────────────────────────────
12:02:23 PM: ​
12:02:23 PM: $ CI= yarn run build
12:02:23 PM: yarn run v1.22.19
12:02:23 PM: $ vite build
12:02:24 PM: vite v4.1.1 building for production...
12:02:24 PM: transforming...
12:02:24 PM: βœ“ 34 modules transformed.
12:02:24 PM: Could not resolve "../assets/Logo.png" from "src/Components/Nav.jsx"
12:02:24 PM: file: /opt/build/repo/src/Components/Nav.jsx
12:02:24 PM: error during build:
12:02:24 PM: RollupError: Could not resolve "../assets/Logo.png" from "src/Components/Nav.jsx"
12:02:24 PM:     at error (file:///opt/build/repo/node_modules/rollup/dist/es/shared/rollup.js:2091:30)
12:02:24 PM:     at ModuleLoader.handleInvalidResolvedId (file:///opt/build/repo/node_modules/rollup/dist/es/shared/rollup.js:23333:24)
12:02:24 PM:     at file:///opt/build/repo/node_modules/rollup/dist/es/shared/rollup.js:23295:26
12:02:24 PM: error Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
12:02:24 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:02:24 PM: ​
12:02:24 PM: "build.command" failed                                        
12:02:24 PM: ────────────────────────────────────────────────────────────────
12:02:24 PM: ​
12:02:24 PM:   Error message
12:02:24 PM:   Command failed with exit code 1: CI= yarn run build (https://ntl.fyi/exit-code-1)
12:02:24 PM: ​
12:02:24 PM:   Error location
12:02:24 PM:   In Build command from Netlify app:
12:02:24 PM:   CI= yarn run build
12:02:24 PM: ​
12:02:24 PM:   Resolved config
12:02:24 PM:   build:
12:02:24 PM:     command: CI= yarn run build
12:02:24 PM:     commandOrigin: ui
12:02:24 PM:     publish: /opt/build/repo/dist
12:02:24 PM:     publishOrigin: ui
12:02:25 PM: Caching artifacts
12:02:25 PM: Started saving node modules
12:02:25 PM: Finished saving node modules
12:02:25 PM: Started saving build plugins
12:02:25 PM: Finished saving build plugins
12:02:25 PM: Started saving corepack cache
12:02:25 PM: Finished saving corepack cache
12:02:25 PM: Started saving yarn cache
12:02:25 PM: Finished saving yarn cache
12:02:25 PM: Started saving pip cache
12:02:25 PM: Finished saving pip cache
12:02:25 PM: Started saving emacs cask dependencies
12:02:25 PM: Finished saving emacs cask dependencies
12:02:25 PM: Started saving maven dependencies
12:02:25 PM: Finished saving maven dependencies
12:02:25 PM: Started saving boot dependencies
12:02:25 PM: Finished saving boot dependencies
12:02:26 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:02:25 PM: Started saving rust rustup cache
12:02:25 PM: Finished saving rust rustup cache
12:02:25 PM: Started saving go dependencies
12:02:25 PM: Finished saving go dependencies
12:02:26 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:02:26 PM: Failing build: Failed to build site
12:02:26 PM: Finished processing build request in 23.986s
type or paste code here

This is because the file is logo.png in the repository. All names in Linux systems (which Netlify build uses) are case sensitive.

Thank you that worked. :+1:

1 Like