Hi, the building is failing in the building stage. According to the log, it cannot find a stylesheet to import but I know that the style sheet is there and working because it works on a local deployment. It is not due to case-sensitivity as all of my file names are already all lowercase. How do I resolve this error and complete the build and deploy?
Netlify site name: https://jazzy-heliotrope-62ab7a.netlify.app/
Screenshot of build settings:
Link to the log:
https://app.netlify.com/sites/jazzy-heliotrope-62ab7a/deploys/650de5590c4ca425cb2d6c4c
Can you post a copy of your build log?
2:04:57 PM: Waiting for other deploys from your team to complete. Check the queue: https://app.netlify.com/teams/zachamoo3/builds
2:05:16 PM: build-image version: 73f16e520fdddf409be6f578c8c2c8941bdf32d3 (focal)
2:05:16 PM: buildbot version: aae36d37bb0728ee6dc52d97c5e1b5b83720773e
2:05:16 PM: Building without cache
2:05:16 PM: Starting to prepare the repo for build
2:05:16 PM: No cached dependencies found. Cloning fresh repo
2:05:16 PM: git clone --filter=blob:none https://github.com/zachamoo3/myflix-client-v1
2:05:16 PM: Preparing Git Reference refs/heads/main
2:05:18 PM: Starting to install dependencies
2:05:18 PM: Python version set to 3.8
2:05:18 PM: Attempting Ruby version 2.7.2, read from environment
2:05:19 PM: Using Ruby version 2.7.2
2:05:19 PM: Started restoring cached go cache
2:05:19 PM: Finished restoring cached go cache
2:05:20 PM: Installing Go version 1.19.13 (requested 1.19.x)
2:05:26 PM: go version go1.19.13 linux/amd64
2:05:26 PM: Using PHP version 8.0
2:05:27 PM: Downloading and installing node v18.18.0...
2:05:28 PM: Downloading https://nodejs.org/dist/v18.18.0/node-v18.18.0-linux-x64.tar.xz...
2:05:28 PM: Computing checksum with sha256sum
2:05:28 PM: Checksums matched!
2:05:30 PM: Now using node v18.18.0 (npm v9.8.1)
2:05:30 PM: Enabling Node.js Corepack
2:05:30 PM: Started restoring cached build plugins
2:05:30 PM: Finished restoring cached build plugins
2:05:30 PM: Started restoring cached corepack dependencies
2:05:30 PM: Finished restoring cached corepack dependencies
2:05:30 PM: No npm workspaces detected
2:05:30 PM: Started restoring cached node modules
2:05:30 PM: Finished restoring cached node modules
2:05:30 PM: Installing npm packages using npm version 9.8.1
2:05:31 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: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
2:05:35 PM: added 246 packages, and audited 247 packages in 4s
2:05:35 PM: 91 packages are looking for funding
2:05:35 PM: run `npm fund` for details
2:05:35 PM: found 0 vulnerabilities
2:05:35 PM: npm packages installed
2:05:35 PM: Install dependencies script success
2:05:35 PM: Starting build script
2:05:36 PM: Detected 1 framework(s)
2:05:36 PM: "parcel" at version "2.9.3"
2:05:36 PM: Section completed: initializing
2:05:38 PM:
2:05:38 PM: Netlify Build
2:05:38 PM: ────────────────────────────────────────────────────────────────
2:05:38 PM:
2:05:38 PM: ❯ Version
2:05:38 PM: @netlify/build 29.21.1
2:05:38 PM:
2:05:38 PM: ❯ Flags
2:05:38 PM: baseRelDir: true
2:05:38 PM: buildId: 650de5590c4ca425cb2d6c4a
2:05:38 PM: deployId: 650de5590c4ca425cb2d6c4c
2:05:38 PM:
2:05:38 PM: ❯ Current directory
2:05:38 PM: /opt/build/repo
2:05:38 PM:
2:05:38 PM: ❯ Config file
2:05:38 PM: /opt/build/repo/netlify.toml
2:05:38 PM:
2:05:38 PM: ❯ Context
2:05:38 PM: production
2:05:38 PM:
2:05:38 PM: Build command from Netlify app
2:05:38 PM: ────────────────────────────────────────────────────────────────
2:05:38 PM:
2:05:38 PM: $ parcel build src/index.html --public-url /
2:05:38 PM: Building...
2:05:39 PM: 🚨 Build failed.
2:05:39 PM: @parcel/transformer-sass: Can"t find stylesheet to import.
╷
2:05:39 PM: 4 │ @import "~bootstrap/scss/bootstrap.scss";
2:05:39 PM: │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2:05:39 PM: ╵
2:05:39 PM: src/index.scss 4:9 root stylesheet
2:05:39 PM: Error: Can"t find stylesheet to import.
╷
2:05:39 PM: 4 │ @import "~bootstrap/scss/bootstrap.scss";
2:05:39 PM: │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2:05:39 PM: ╵
2:05:39 PM: src/index.scss 4:9 root stylesheet
2:05:39 PM: at Object.wrapException
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:1252:43)
2:05:39 PM: at /opt/build/repo/node_modules/sass/sass.dart.js:79273:25
2:05:39 PM: at _wrapJsFunctionForAsync_closure.$protected
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:3995:15)
2:05:39 PM: at _wrapJsFunctionForAsync_closure.call$2
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:32103:12)
2:05:39 PM: at _awaitOnObject_closure.call$1
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:32091:32)
2:05:39 PM: at Object._rootRunUnary
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:4382:18)
2:05:39 PM: at StaticClosure.<anonymous>
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:112142:16)
2:05:39 PM: at _CustomZone.runUnary$2$2
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:33527:39)
2:05:39 PM: at _Future__propagateToListeners_handleValueCallback.call$0
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:32590:51)
2:05:39 PM: at Object._Future__propagateToListeners
2:05:39 PM: (/opt/build/repo/node_modules/sass/sass.dart.js:4175:93)
2:05:40 PM:
2:05:40 PM: "build.command" failed
2:05:40 PM: ────────────────────────────────────────────────────────────────
2:05:40 PM:
2:05:40 PM: Error message
2:05:40 PM: Command failed with exit code 1: parcel build src/index.html --public-url / (https://ntl.fyi/exit-code-1)
2:05:40 PM:
2:05:40 PM: Error location
2:05:40 PM: In Build command from Netlify app:
2:05:40 PM: parcel build src/index.html --public-url /
2:05:40 PM:
2:05:40 PM: Resolved config
2:05:40 PM: build:
2:05:40 PM: command: parcel build src/index.html --public-url /
2:05:40 PM: commandOrigin: ui
2:05:40 PM: publish: /opt/build/repo/dist
2:05:40 PM: publishOrigin: ui
2:05:40 PM: redirects:
2:05:40 PM: - from: /*
status: 200
to: /
redirectsOrigin: config
Caching artifacts
2:05:40 PM: Started saving node modules
2:05:40 PM: Finished saving node modules
2:05:40 PM: Started saving build plugins
2:05:40 PM: Finished saving build plugins
2:05:40 PM: Started saving corepack cache
2:05:40 PM: Finished saving corepack cache
2:05:40 PM: Started saving pip cache
2:05:40 PM: Finished saving pip cache
2:05:40 PM: Started saving emacs cask dependencies
2:05:40 PM: Finished saving emacs cask dependencies
2:05:40 PM: Started saving maven dependencies
2:05:40 PM: Finished saving maven dependencies
2:05:40 PM: Started saving boot dependencies
2:05:40 PM: Finished saving boot dependencies
2:05:40 PM: Started saving rust rustup cache
2:05:40 PM: Finished saving rust rustup cache
2:05:40 PM: Started saving go dependencies
2:05:40 PM: Finished saving go dependencies
2:05:41 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
2:05:41 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:05:41 PM: Failing build: Failed to build site
2:05:42 PM: Finished processing build request in 25.986s
@tomrutgers It is now fixed but am I not entirely sure how. I had a recommendation to remove
"main": "index.js"
from my package.json file and after that it was able to build successfully.
Glad to hear it’s resolved