Deploy failing at Building Step

I’m trying to deploy a React project for the first time on Netlify but it keeps failing at the building step.
Please help :pray:

I have attached the building log below

9:07:58 PM: build-image version: ecdc8b770f4a0193fd3f258c1bc6029e681813a4 (focal)
9:07:58 PM: buildbot version: f5b00da9ea784e11c7a9a1c4adf63924b3bd4269
9:07:58 PM: Fetching cached dependencies
9:07:58 PM: Failed to fetch cache, continuing with build
9:07:58 PM: Starting to prepare the repo for build
9:07:58 PM: No cached dependencies found. Cloning fresh repo
9:07:58 PM: git clone --filter=blob:none https://github.com/TheaWin/eiga-client
9:07:58 PM: Preparing Git Reference refs/heads/main
9:08:01 PM: Starting to install dependencies
9:08:01 PM: Python version set to 3.8
9:08:01 PM: Attempting Ruby version 2.7.2, read from environment
9:08:02 PM: Using Ruby version 2.7.2
9:08:02 PM: Started restoring cached go cache
9:08:02 PM: Finished restoring cached go cache
9:08:03 PM: go version go1.19.13 linux/amd64
9:08:04 PM: Using PHP version 8.0
9:08:05 PM: Downloading and installing node v16.19.0...
9:08:05 PM: Downloading https://nodejs.org/dist/v16.19.0/node-v16.19.0-linux-x64.tar.xz...
9:08:06 PM: Computing checksum with sha256sum
9:08:06 PM: Checksums matched!
9:08:08 PM: Now using node v16.19.0 (npm v8.19.3)
9:08:08 PM: Enabling Node.js Corepack
9:08:08 PM: Started restoring cached build plugins
9:08:08 PM: Finished restoring cached build plugins
9:08:08 PM: Started restoring cached corepack dependencies
9:08:08 PM: Finished restoring cached corepack dependencies
9:08:08 PM: No npm workspaces detected
9:08:08 PM: Started restoring cached node modules
9:08:08 PM: Finished restoring cached node modules
9:08:08 PM: Installing npm packages using npm version 8.19.3
9:08:12 PM: npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
9:08:12 PM: npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
9:08:12 PM: npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
9:08:13 PM: npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
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
9:08:13 PM: npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
9:08:13 PM: npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
9:08:13 PM: npm WARN deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
9:08:13 PM: npm WARN deprecated
9:08:13 PM: npm WARN deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
9:08:13 PM: npm WARN deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
9:08:14 PM: npm WARN deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
9:08:17 PM: npm WARN deprecated domexception@2.0.1: Use your platform's native DOMException instead
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
9:08:17 PM: npm WARN deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
9:08:17 PM: npm WARN deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
9:08:17 PM: npm WARN deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
9:08:17 PM: npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
9:08:17 PM: npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
9:08:17 PM: npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
9:08:19 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
9:08:43 PM: added 1523 packages, and audited 1524 packages in 34s
9:08:43 PM: 349 packages are looking for funding
9:08:43 PM:   run `npm fund` for details
9:08:43 PM: 98 vulnerabilities (47 moderate, 51 high)
9:08:43 PM: To address issues that do not require attention, run:
9:08:43 PM:   npm audit fix
9:08:43 PM: To address all issues (including breaking changes), run:
9:08:43 PM:   npm audit fix --force
9:08:43 PM: Run `npm audit` for details.
9:08:43 PM: npm packages installed
9:08:44 PM: Successfully installed dependencies
9:08:44 PM: Starting build script
9:08:45 PM: Detected 2 framework(s)
9:08:45 PM: "create-react-app" at version "5.0.1"
9:08:45 PM: "parcel" at version "2.9.3"
9:08:45 PM: Section completed: initializing
9:08:47 PM: ​
9:08:47 PM: Netlify Build                                                 
9:08:47 PM: ────────────────────────────────────────────────────────────────
9:08:47 PM: ​
9:08:47 PM: ❯ Version
9:08:47 PM:   @netlify/build 29.53.0
9:08:47 PM: ​
9:08:47 PM: ❯ Flags
9:08:47 PM:   accountId: 66ba29471c5cc2c039094d48
9:08:47 PM:   baseRelDir: true
9:08:47 PM:   buildId: 66c77063701b310008a8386b
9:08:47 PM:   deployId: 66c77063701b310008a8386d
9:08:47 PM: ​
9:08:47 PM: ❯ Current directory
9:08:47 PM:   /opt/build/repo
9:08:47 PM: ​
9:08:47 PM: ❯ Config file
9:08:47 PM:   /opt/build/repo/netlify.toml
9:08:47 PM: ​
9:08:47 PM: ❯ Context
9:08:47 PM:   production
9:08:47 PM: ​
9:08:47 PM: build.command from netlify.toml                               
9:08:47 PM: ────────────────────────────────────────────────────────────────
9:08:47 PM: ​
9:08:47 PM: $ parcel build src/index.html --public-url /
9:08:47 PM: Building...
9:08:49 PM: DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
9:08:49 PM: version. To keep the existing behavior, move the declaration above the nested
9:08:49 PM: rule. To opt into the new behavior, wrap the declaration in `& {}`.
9:08:49 PM: More info: https://sass-lang.com/d/mixed-decls
9:08:49 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/_reboot.scss
9:08:49 PM: 503 β”‚     font-weight: $legend-font-weight;
9:08:49 PM:     β”‚     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
9:08:49 PM:     β•΅
9:08:49 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/vendor/_rfs.scss
9:08:49 PM: 136 β”‚ β”Œ     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
9:08:49 PM: 137 β”‚ β”‚       @content;
9:08:49 PM: 138 β”‚ β”‚     }
9:08:49 PM:     β”‚ └─── nested rule
9:08:49 PM:     β•΅
9:08:49 PM:     node_modules/bootstrap/scss/_reboot.scss 503:3   @import
9:08:49 PM:     node_modules/bootstrap/scss/bootstrap.scss 16:9  @import
9:08:49 PM:     src/index.scss 12:9                              root stylesheet
9:08:52 PM: DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
9:08:52 PM: version. To keep the existing behavior, move the declaration above the nested
9:08:52 PM: rule. To opt into the new behavior, wrap the declaration in `& {}`.
9:08:52 PM: More info: https://sass-lang.com/d/mixed-decls
9:08:52 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/_reboot.scss
9:08:52 PM: 504 β”‚     line-height: inherit;
9:08:52 PM:     β”‚     ^^^^^^^^^^^^^^^^^^^^ declaration
9:08:52 PM:     β•΅
9:08:52 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/vendor/_rfs.scss
9:08:52 PM: 136 β”‚ β”Œ     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
9:08:52 PM: 137 β”‚ β”‚       @content;
9:08:52 PM: 138 β”‚ β”‚     }
9:08:52 PM:     β”‚ └─── nested rule
9:08:52 PM:     β•΅
9:08:52 PM:     node_modules/bootstrap/scss/_reboot.scss 504:3   @import
9:08:52 PM:     node_modules/bootstrap/scss/bootstrap.scss 16:9  @import
9:08:52 PM:     src/index.scss 12:9                              root stylesheet
9:08:52 PM: DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
9:08:52 PM: version. To keep the existing behavior, move the declaration above the nested
9:08:52 PM: rule. To opt into the new behavior, wrap the declaration in `& {}`.
9:08:52 PM: More info: https://sass-lang.com/d/mixed-decls
9:08:52 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/_type.scss
9:08:52 PM: 38  β”‚       font-family: $display-font-family;
9:08:52 PM:     β”‚       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
9:08:52 PM:     β•΅
9:08:52 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/vendor/_rfs.scss
9:08:52 PM: 136 β”‚ β”Œ     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
9:08:52 PM: 137 β”‚ β”‚       @content;
9:08:52 PM: 138 β”‚ β”‚     }
9:08:52 PM:     β”‚ └─── nested rule
9:08:52 PM:     β•΅
9:08:52 PM:     node_modules/bootstrap/scss/_type.scss 38:5      @import
9:08:52 PM:     node_modules/bootstrap/scss/bootstrap.scss 17:9  @import
9:08:52 PM:     src/index.scss 12:9                              root stylesheet
9:08:52 PM: DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
9:08:52 PM: version. To keep the existing behavior, move the declaration above the nested
9:08:52 PM: rule. To opt into the new behavior, wrap the declaration in `& {}`.
9:08:52 PM: More info: https://sass-lang.com/d/mixed-decls
9:08:52 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/_type.scss
9:08:52 PM: 39  β”‚       font-style: $display-font-style;
9:08:52 PM:     β”‚       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
9:08:52 PM:     β•΅
9:08:52 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/vendor/_rfs.scss
9:08:52 PM: 136 β”‚ β”Œ     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
9:08:52 PM: 137 β”‚ β”‚       @content;
9:08:52 PM: 138 β”‚ β”‚     }
9:08:52 PM:     β”‚ └─── nested rule
9:08:52 PM:     β•΅
9:08:52 PM:     node_modules/bootstrap/scss/_type.scss 39:5      @import
9:08:52 PM:     node_modules/bootstrap/scss/bootstrap.scss 17:9  @import
9:08:52 PM:     src/index.scss 12:9                              root stylesheet
9:08:52 PM: DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
9:08:52 PM: version. To keep the existing behavior, move the declaration above the nested
9:08:52 PM: rule. To opt into the new behavior, wrap the declaration in `& {}`.
9:08:52 PM: More info: https://sass-lang.com/d/mixed-decls
9:08:52 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/_type.scss
9:08:52 PM: 40  β”‚       font-weight: $display-font-weight;
9:08:52 PM:     β”‚       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declaration
9:08:52 PM:     β•΅
9:08:52 PM:     β”Œβ”€β”€> node_modules/bootstrap/scss/vendor/_rfs.scss
9:08:52 PM: 136 β”‚ β”Œ     @media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
9:08:52 PM: 137 β”‚ β”‚       @content;
9:08:52 PM: 138 β”‚ β”‚     }
9:08:52 PM:     β”‚ └─── nested rule
9:08:52 PM:     β•΅
9:08:52 PM:     node_modules/bootstrap/scss/_type.scss 40:5      @import
9:08:52 PM:     node_modules/bootstrap/scss/bootstrap.scss 17:9  @import
9:08:52 PM:     src/index.scss 12:9                              root stylesheet
9:08:52 PM: WARNING: 22 repetitive deprecation warnings omitted.
9:08:53 PM: Bundling...
9:08:53 PM: 🚨 Build failed.
9:08:53 PM: Error: The expression evaluated to a falsy value:
9:08:53 PM: 
9:08:53 PM:   (0, _assert().default)(bundleGraph instanceof _BundleGraph.default)
9:08:53 PM: 
9:08:53 PM:   AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
9:08:53 PM:   
9:08:53 PM:     (0, _assert().default)(bundleGraph instanceof _BundleGraph.default)
9:08:53 PM:   
9:08:53 PM:       at Object.runPackage 
9:08:53 PM:   (/opt/build/repo/node_modules/parcel/node_modules/@parcel/core/lib/worker.js:134:25)
9:08:53 PM:       at Child.handleRequest 
9:08:53 PM:   (/opt/build/repo/node_modules/@parcel/workers/lib/child.js:193:34)
9:08:53 PM:       at Child.messageListener 
9:08:53 PM:   (/opt/build/repo/node_modules/@parcel/workers/lib/child.js:93:19)
9:08:53 PM:       at ThreadsChild.onMessage 
9:08:53 PM:   (/opt/build/repo/node_modules/@parcel/workers/lib/child.js:66:12)
9:08:53 PM:       at ThreadsChild.handleMessage 
9:08:53 PM:   (/opt/build/repo/node_modules/@parcel/workers/lib/threads/ThreadsChild.js:42:10)
9:08:53 PM:       at MessagePort.<anonymous> 
9:08:53 PM:   (/opt/build/repo/node_modules/@parcel/workers/lib/threads/ThreadsChild.js:38:61)
9:08:53 PM:       at MessagePort.[nodejs.internal.kHybridDispatch] 
9:08:53 PM:   (node:internal/event_target:736:20)
9:08:53 PM:       at MessagePort.exports.emitMessage 
9:08:53 PM:   (node:internal/per_context/messageport:23:28)
9:08:53 PM: ​
9:08:53 PM: "build.command" failed                                        
9:08:53 PM: ────────────────────────────────────────────────────────────────
9:08:53 PM: ​
9:08:53 PM:   Error message
9:08:53 PM:   Command failed with exit code 1: parcel build src/index.html --public-url / (https://ntl.fyi/exit-code-1)
9:08:53 PM: ​
9:08:53 PM:   Error location
9:08:53 PM:   In build.command from netlify.toml:
9:08:53 PM:   parcel build src/index.html --public-url /
9:08:53 PM: ​
9:08:53 PM:   Resolved config
9:08:53 PM:   build:
9:08:53 PM:     command: parcel build src/index.html --public-url /
9:08:53 PM:     commandOrigin: config
9:08:53 PM:     environment:
9:08:53 PM:       - NODE_VERSION
9:08:53 PM:     processing:
9:08:53 PM:       skip_processing: true
9:08:53 PM:     publish: /opt/build/repo/dist
9:08:53 PM:     publishOrigin: config
9:08:53 PM:   redirects:
9:08:53 PM:     - from: /*
      status: 200
      to: /
  redirectsOrigin: config
9:08:53 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:08:54 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:08:54 PM: Failing build: Failed to build site
9:08:54 PM: Finished processing build request in 56.246s

Screenshot 2024-08-22 211608

@TheaWin Does exactly the same build command run correctly for you locally?

You might want to google around, as I see there are a fair few results to be found offering various suggestions.

parcel "the expression evaluated to a falsy value"

Including this thread from these forums:
https://answers.netlify.com/t/failed-deploy-build-command/114429

Where the solution was apparently:

@nathanmartin the exact same build command works locally.

I have tried deploying with parcel@2.11.0 also and it didn’t work. I have also try building with the build command ./node_modules/.bin/parcel build src/index.html --no-cache and it also doesn’t work.

@TheaWin Do you have a public repository for your project?

Thank you for the help! The app just got deployed. :rocket: I ran npm update on my project, and it worked. It seems the key change was updating Parcel from v2.11.0 to v2.12.0, though I’m not entirely sure if that was the sole fix.

Great, hopefully it doesn’t reoccur for you!

thanks for coming back and sharing your solution with the community!