Home
Support Forums

Build command is saying it cannot find CSS file in src folder

I have setup continuous deployment for my simple temperature conversion app built using React + TypeScript. However, I keep getting the same error message:

Cannot find file ‘./scss/app.min.css’ in ‘./src’.

Here is a link to the GitHub repo:

There is clearly a CSS file of that name in that folder. Running yarn build locally works just fine. I compared this project to my other projects, and I use the same file/folder structure in all of them, so I really have no idea why this is not working

Here is the full build log:

3:34:13 PM: Build ready to start
3:34:15 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
3:34:15 PM: build-image tag: v3.7.6
3:34:15 PM: buildbot version: 00e794c8abfdf634e411d5afc169b41bd6a2f9f3
3:34:15 PM: Building without cache
3:34:15 PM: Starting to prepare the repo for build
3:34:16 PM: No cached dependencies found. Cloning fresh repo
3:34:16 PM: git clone https://github.com/andrews1022/temperature-converter-react-typescript
3:34:17 PM: Preparing Git Reference refs/heads/master
3:34:17 PM: Parsing package.json dependencies
3:34:18 PM: Starting build script
3:34:18 PM: Installing dependencies
3:34:18 PM: Python version set to 2.7
3:34:19 PM: v12.18.0 is already installed.
3:34:20 PM: Now using node v12.18.0 (npm v6.14.4)
3:34:20 PM: Started restoring cached build plugins
3:34:20 PM: Finished restoring cached build plugins
3:34:20 PM: Attempting ruby version 2.7.1, read from environment
3:34:22 PM: Using ruby version 2.7.1
3:34:22 PM: Using PHP version 5.6
3:34:22 PM: Started restoring cached yarn cache
3:34:22 PM: Finished restoring cached yarn cache
3:34:22 PM: Installing yarn at version 1.22.4
3:34:22 PM: Installing Yarn!
3:34:22 PM: > Downloading tarball...
3:34:22 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.4wuunVCoWt
3:34:22 PM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
3:34:22 PM:                                  Dload  Upload   Total   Spent    Left  Speed
3:34:22 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
3:34:22 PM: 100    79  100    79    0     0    441      0 --:--:-- --:--:-- --:--:--   443
3:34:23 PM: 100    93  100    93    0     0    166      0 --:--:-- --:--:-- --:--:--   166
3:34:23 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
3:34:23 PM: 100   625  100   625    0     0    712      0 --:--:-- --:--:-- --:--:--  5896
3:34:24 PM: 100 1215k  100 1215k    0     0   989k      0  0:00:01  0:00:01 --:--:--  989k
3:34:24 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.4wuunVCoWt.asc
3:34:24 PM: 100    83  100    83    0     0   2180      0 --:--:-- --:--:-- --:--:--  2180
3:34:24 PM: 100    97  100    97    0     0   1424      0 --:--:-- --:--:-- --:--:--  1424
3:34:24 PM: 100   629  100   629    0     0   4095      0 --:--:-- --:--:-- --:--:--  4095
3:34:24 PM: 100  1028  100  1028    0     0   5009      0 --:--:-- --:--:-- --:--:--  5009
3:34:24 PM: > Verifying integrity...
3:34:24 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
3:34:24 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
3:34:24 PM: gpg: WARNING: This key is not certified with a trusted signature!
3:34:24 PM: gpg:          There is no indication that the signature belongs to the owner.
3:34:24 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
3:34:24 PM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
3:34:24 PM: > GPG signature looks good
3:34:24 PM: > Extracting to ~/.yarn...
3:34:24 PM: > Adding to $PATH...
3:34:24 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.
3:34:25 PM: No yarn workspaces detected
3:34:25 PM: Started restoring cached node modules
3:34:25 PM: Finished restoring cached node modules
3:34:25 PM: Installing NPM modules using Yarn version 1.22.4
3:34:25 PM: yarn install v1.22.4
3:34:26 PM: [1/4] Resolving packages...
3:34:26 PM: [2/4] Fetching packages...
3:34:52 PM: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
3:34:52 PM: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
3:34:52 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
3:34:52 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
3:34:52 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
3:34:52 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
3:34:52 PM: [3/4] Linking dependencies...
3:34:52 PM: warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5".
3:35:07 PM: [4/4] Building fresh packages...
3:35:08 PM: Done in 42.92s.
3:35:08 PM: NPM modules installed using Yarn
3:35:09 PM: Started restoring cached go cache
3:35:09 PM: Finished restoring cached go cache
3:35:09 PM: go version go1.14.4 linux/amd64
3:35:09 PM: go version go1.14.4 linux/amd64
3:35:09 PM: Installing missing commands
3:35:09 PM: Verify run directory
3:35:09 PM: ​
3:35:09 PM: ────────────────────────────────────────────────────────────────
3:35:09 PM:   Netlify Build                                                 
3:35:09 PM: ────────────────────────────────────────────────────────────────
3:35:09 PM: ​
3:35:09 PM: ❯ Version
3:35:09 PM:   @netlify/build 12.1.0
3:35:09 PM: ​
3:35:09 PM: ❯ Flags
3:35:09 PM:   deployId: 60c536658b47cab89a716196
3:35:09 PM: ​
3:35:09 PM: ❯ Current directory
3:35:09 PM:   /opt/build/repo
3:35:09 PM: ​
3:35:09 PM: ❯ Config file
3:35:09 PM:   No config file was defined: using default values.
3:35:09 PM: ​
3:35:09 PM: ❯ Context
3:35:09 PM:   production
3:35:09 PM: ​
3:35:09 PM: ────────────────────────────────────────────────────────────────
3:35:09 PM:   1. Build command from Netlify app                             
3:35:09 PM: ────────────────────────────────────────────────────────────────
3:35:09 PM: ​
3:35:09 PM: $ yarn build
3:35:10 PM: yarn run v1.22.4
3:35:10 PM: $ react-scripts build
3:35:11 PM: Creating an optimized production build...
3:35:20 PM: Failed to compile.
3:35:20 PM: 
3:35:20 PM: ./src/App.tsx
3:35:20 PM: Cannot find file './scss/app.min.css' in './src'.
3:35:20 PM: error Command failed with exit code 1.
3:35:20 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
3:35:20 PM: ​
3:35:20 PM: ────────────────────────────────────────────────────────────────
3:35:20 PM:   "build.command" failed                                        
3:35:20 PM: ────────────────────────────────────────────────────────────────
3:35:20 PM: ​
3:35:20 PM:   Error message
3:35:20 PM:   Command failed with exit code 1: yarn build
3:35:20 PM: ​
3:35:20 PM:   Error location
3:35:20 PM:   In Build command from Netlify app:
3:35:20 PM:   yarn build
3:35:20 PM: ​
3:35:20 PM:   Resolved config
3:35:20 PM:   build:
3:35:20 PM:     command: yarn build
3:35:20 PM:     commandOrigin: ui
3:35:20 PM:     publish: /opt/build/repo/build
3:35:20 PM:   functions:
3:35:20 PM:     '*': {}
3:35:21 PM: Caching artifacts
3:35:21 PM: Started saving node modules
3:35:21 PM: Finished saving node modules
3:35:21 PM: Started saving build plugins
3:35:21 PM: Finished saving build plugins
3:35:21 PM: Started saving yarn cache
3:35:21 PM: Finished saving yarn cache
3:35:21 PM: Started saving pip cache
3:35:21 PM: Finished saving pip cache
3:35:21 PM: Started saving emacs cask dependencies
3:35:21 PM: Finished saving emacs cask dependencies
3:35:21 PM: Started saving maven dependencies
3:35:21 PM: Finished saving maven dependencies
3:35:21 PM: Started saving boot dependencies
3:35:21 PM: Finished saving boot dependencies
3:35:21 PM: Started saving rust rustup cache
3:35:21 PM: Finished saving rust rustup cache
3:35:21 PM: Started saving go dependencies
3:35:21 PM: Finished saving go dependencies
3:35:24 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:35:24 PM: Creating deploy upload records
3:35:24 PM: Failing build: Failed to build site
3:35:24 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
3:35:24 PM: Finished processing build request in 1m9.024842686s

Here is my package.json:

{

  "name": "project-32-temperature-converter-react-typescript",

  "version": "0.1.0",

  "private": true,

  "dependencies": {

    "@fortawesome/fontawesome-svg-core": "^1.2.35",

    "@fortawesome/free-brands-svg-icons": "^5.15.3",

    "@fortawesome/free-solid-svg-icons": "^5.15.3",

    "@fortawesome/react-fontawesome": "^0.1.14",

    "@testing-library/jest-dom": "^4.2.4",

    "@testing-library/react": "^9.3.2",

    "@testing-library/user-event": "^7.1.2",

    "@types/jest": "^24.0.0",

    "@types/node": "^12.0.0",

    "@types/react": "^16.9.0",

    "@types/react-dom": "^16.9.0",

    "react": "^16.13.1",

    "react-dom": "^16.13.1",

    "react-scripts": "3.4.3",

    "typescript": "~3.7.2"

  },

  "scripts": {

    "start": "react-scripts start",

    "build": "react-scripts build",

    "test": "react-scripts test",

    "eject": "react-scripts eject"

  },

  "eslintConfig": {

    "extends": "react-app"

  },

  "browserslist": {

    "production": [

      ">0.2%",

      "not dead",

      "not op_mini all"

    ],

    "development": [

      "last 1 chrome version",

      "last 1 firefox version",

      "last 1 safari version"

    ]

  }

}

And here are my build settings:

I have also tried running the following commands, as suggested elsewhere:
npx browserslist@latest --update-db
npm audit fix

But they did not resolve the issue. I did notice the publish directory was build/, while all my other projects used just build with no /. That also did not resolve the issue.

Any help with this would certainly be appreciated!

Thanks!

Hi @andrews1022

Welcome to the Netlify community :netliconfetti:

That’s because the file is App.min.css (case-senstive) as per screenshot below.

1 Like

Yes that was it, thank you. Kind of annoying because I renamed it with lowercase to match my other projects for consistency, but it’s not detected as a change by git. So, I renamed it to index and everything built properly. Thank you for the quick reply!

1 Like