Vue vite Build script returned non-zero exit code: 2

9:14:01 AM: Build ready to start
9:14:03 AM: build-image version: 0e2f4c52031ab562db66aec633308326e3b108d0 (focal)
9:14:03 AM: build-image tag: focal
9:14:03 AM: buildbot version: 92fdf6c9673723ad7f3b62ee278f375a17a73dd6
9:14:04 AM: Fetching cached dependencies
9:14:04 AM: Failed to fetch cache, continuing with build
9:14:04 AM: Starting to prepare the repo for build
9:14:04 AM: No cached dependencies found. Cloning fresh repo
9:14:04 AM: git clone https://github.com/johnl6234/protia
9:14:04 AM: Preparing Git Reference refs/heads/master
9:14:04 AM: Parsing package.json dependencies
9:14:05 AM: Different build dir detected, going to use the one specified in the Netlify configuration file: '' versus '/' in the Netlify UI
9:14:06 AM: Starting build script
9:14:06 AM: Installing dependencies
9:14:06 AM: Python version set to 2.7
9:14:06 AM: Downloading and installing node v16.16.0...
9:14:07 AM: Downloading https://nodejs.org/dist/v16.16.0/node-v16.16.0-linux-x64.tar.xz...
9:14:07 AM: Computing checksum with sha256sum
9:14:07 AM: Checksums matched!
9:14:10 AM: Now using node v16.16.0 (npm v8.11.0)
9:14:10 AM: Started restoring cached build plugins
9:14:10 AM: Finished restoring cached build plugins
9:14:10 AM: Attempting ruby version 2.7.2, read from environment
9:14:11 AM: Using ruby version 2.7.2
9:14:11 AM: Using PHP version 8.0
9:14:12 AM: No npm workspaces detected
9:14:12 AM: Started restoring cached node modules
9:14:12 AM: Finished restoring cached node modules
9:14:12 AM: Installing NPM modules using NPM version 8.11.0
9:14:13 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
9:14:13 AM: npm WARN config location in the cache, and they are managed by
9:14:13 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
9:14:13 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
9:14:13 AM: npm WARN config location in the cache, and they are managed by
9:14:13 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
9:14:19 AM: added 163 packages, and audited 164 packages in 6s
9:14:19 AM: 21 packages are looking for funding
9:14:19 AM:   run `npm fund` for details
9:14:19 AM: found 0 vulnerabilities
9:14:19 AM: NPM modules installed
9:14:19 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
9:14:19 AM: npm WARN config location in the cache, and they are managed by
9:14:19 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
9:14:19 AM: Started restoring cached go cache
9:14:19 AM: Finished restoring cached go cache
9:14:19 AM: Installing Go version 1.17 (requested 1.17)
9:14:25 AM: unset GOOS;
9:14:25 AM: unset GOARCH;
9:14:25 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
9:14:25 AM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
9:14:25 AM: go version >&2;
9:14:25 AM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
9:14:25 AM: go version go1.17 linux/amd64
9:14:25 AM: Installing missing commands
9:14:25 AM: Verify run directory
9:14:27 AM: ​
9:14:27 AM: ────────────────────────────────────────────────────────────────
9:14:27 AM:   Netlify Build                                                 
9:14:27 AM: ────────────────────────────────────────────────────────────────
9:14:27 AM: ​
9:14:27 AM: ❯ Version
9:14:27 AM:   @netlify/build 27.4.2
9:14:27 AM: ​
9:14:27 AM: ❯ Flags
9:14:27 AM:   baseRelDir: true
9:14:27 AM:   buildId: 62d7b949658ee300082a2d2f
9:14:27 AM:   deployId: 62d7b949658ee300082a2d31
9:14:27 AM: ​
9:14:27 AM: ❯ Current directory
9:14:27 AM:   /opt/build/repo
9:14:27 AM: ​
9:14:27 AM: ❯ Config file
9:14:27 AM:   No config file was defined: using default values.
9:14:27 AM: ​
9:14:27 AM: ❯ Context
9:14:27 AM:   production
9:14:27 AM: ​
9:14:27 AM: ────────────────────────────────────────────────────────────────
9:14:27 AM:   1. Build command from Netlify app                             
9:14:27 AM: ────────────────────────────────────────────────────────────────
9:14:27 AM: ​
9:14:27 AM: $ npm run build
9:14:27 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
9:14:27 AM: npm WARN config location in the cache, and they are managed by
9:14:27 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
9:14:27 AM: > client@0.0.0 build
9:14:27 AM: > vite build
9:14:27 AM: vite v2.9.13 building for production...
9:14:27 AM: transforming...
9:14:29 AM: βœ“ 90 modules transformed.
9:14:29 AM: [vite:load-fallback] Could not load /opt/build/repo/src/components/workouts/BaseWorkoutCard.vue (imported by src/views/CreateWorkoutView.vue): ENOENT: no such file or directory, open '/opt/build/repo/src/components/workouts/BaseWorkoutCard.vue'
9:14:29 AM: error during build:
9:14:29 AM: Error: Could not load /opt/build/repo/src/components/workouts/BaseWorkoutCard.vue (imported by src/views/CreateWorkoutView.vue): ENOENT: no such file or directory, open '/opt/build/repo/src/components/workouts/BaseWorkoutCard.vue'
9:14:29 AM: ​
9:14:29 AM: ────────────────────────────────────────────────────────────────
9:14:29 AM:   "build.command" failed                                        
9:14:29 AM: ────────────────────────────────────────────────────────────────
9:14:29 AM: ​
9:14:29 AM:   Error message
9:14:29 AM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
9:14:29 AM: ​
9:14:29 AM:   Error location
9:14:29 AM:   In Build command from Netlify app:
9:14:29 AM:   npm run build
9:14:29 AM: ​
9:14:29 AM:   Resolved config
9:14:29 AM:   build:
9:14:29 AM:     base: /opt/build/repo
9:14:29 AM:     command: npm run build
9:14:29 AM:     commandOrigin: ui
9:14:29 AM:     environment:
9:14:29 AM:       - VITE_MAPBOX_ACCESS_TOKEN
9:14:29 AM:       - VITE_SERVER_URI
9:14:29 AM:     publish: /opt/build/repo/dist
9:14:29 AM:     publishOrigin: ui
9:14:30 AM: Caching artifacts
9:14:30 AM: Started saving node modules
9:14:30 AM: Finished saving node modules
9:14:30 AM: Started saving build plugins
9:14:30 AM: Finished saving build plugins
9:14:30 AM: Started saving pip cache
9:14:30 AM: Finished saving pip cache
9:14:30 AM: Started saving emacs cask dependencies
9:14:30 AM: Finished saving emacs cask dependencies
9:14:30 AM: Started saving maven dependencies
9:14:30 AM: Finished saving maven dependencies
9:14:30 AM: Started saving boot dependencies
9:14:30 AM: Finished saving boot dependencies
9:14:30 AM: Started saving rust rustup cache
9:14:30 AM: Finished saving rust rustup cache
9:14:30 AM: Started saving go dependencies
9:14:30 AM: Finished saving go dependencies
9:14:31 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:14:31 AM: Creating deploy upload records
9:14:32 AM: Failing build: Failed to build site
9:14:32 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:14:32 AM: Finished processing build request in 28.409343114s

im asumming that this is the problem

9:14:29 AM: [vite:load-fallback] Could not load /opt/build/repo/src/components/workouts/BaseWorkoutCard.vue (imported by src/views/CreateWorkoutView.vue): ENOENT: no such file or directory, open '/opt/build/repo/src/components/workouts/BaseWorkoutCard.vue'
9:14:29 AM: error during build:
9:14:29 AM: Error: Could not load /opt/build/repo/src/components/workouts/BaseWorkoutCard.vue (imported by src/views/CreateWorkoutView.vue): ENOENT: no such file or directory, open '/opt/build/repo/src/components/workouts/BaseWorkoutCard.vue'

but the files exist and in the right place
this is the folder layout

@johnl6234 If you look closely you’ll see that they aren’t precisely the same file when case sensitivity is taken into account.

You’re referencing BaseWorkoutCard.vue but the file is named baseWorkoutCard.vue.

If you’re working on a system that isn’t case sensitive just be extra careful with the names of everything, because the build server is case sensitive.

1 Like

Thank you I had just seen that builds ok now