Home
Support Forums

Folder mapping issue while deploying on netlify it builds fine locally but throw error while building on netlify

6:25:42 PM: Build ready to start
6:25:44 PM: build-image version: 081db65c3e4ce8423fedb40e7689a87de6f84667
6:25:44 PM: build-image tag: v4.3.1
6:25:44 PM: buildbot version: 1523fa12d6de79e532ed0aff71973c5fbb8e58aa
6:25:44 PM: Fetching cached dependencies
6:25:44 PM: Failed to fetch cache, continuing with build
6:25:44 PM: Starting to prepare the repo for build
6:25:44 PM: No cached dependencies found. Cloning fresh repo
6:25:44 PM: git clone GitHub - GaadMaiyaki/cloudfift-assessment: assessment
6:25:45 PM: Preparing Git Reference refs/heads/main
6:25:45 PM: Parsing package.json dependencies
6:25:46 PM: Starting build script
6:25:46 PM: Installing dependencies
6:25:46 PM: Python version set to 2.7
6:25:47 PM: Downloading and installing node v16.10.0…
6:25:47 PM: Downloading https://nodejs.org/dist/v16.10.0/node-v16.10.0-linux-x64.tar.xz…
6:25:47 PM: Computing checksum with sha256sum
6:25:47 PM: Checksums matched!
6:25:50 PM: Now using node v16.10.0 (npm v7.24.0)
6:25:50 PM: Started restoring cached build plugins
6:25:50 PM: Finished restoring cached build plugins
6:25:50 PM: Attempting ruby version 2.7.2, read from environment
6:25:52 PM: Using ruby version 2.7.2
6:25:52 PM: Using PHP version 8.0
6:25:52 PM: Started restoring cached yarn cache
6:25:52 PM: Finished restoring cached yarn cache
6:25:52 PM: Installing yarn at version 1.22.10
6:25:52 PM: Installing Yarn!
6:25:52 PM: > Downloading tarball…
6:25:52 PM: [1/2]: https://yarnpkg.com/downloads/1.22.10/yarn-v1.22.10.tar.gz β†’ /tmp/yarn.tar.gz.S3lVlsHu9F
6:25:52 PM: % Total % Received % Xferd Average Speed Time Time Time Current
6:25:52 PM: Dload Upload Total Spent Left Speed
6:25:52 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
6:25:52 PM: 100 81 100 81 0 0 692 0 --:–:-- --:–:-- --:–:-- 692
6:25:52 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
6:25:52 PM: 100 95 100 95 0 0 295 0 --:–:-- --:–:-- --:–:-- 549
6:25:52 PM: 100 626 100 626 0 0 1252 0 --:–:-- --:–:-- --:–:-- 1252
6:25:53 PM: 100 1215k 100 1215k 0 0 1764k 0 --:–:-- --:–:-- --:–:-- 1764k
6:25:53 PM: [2/2]: https://yarnpkg.com/downloads/1.22.10/yarn-v1.22.10.tar.gz.asc β†’ /tmp/yarn.tar.gz.S3lVlsHu9F.asc
6:25:53 PM: % Total % Received % Xferd Average Speed Time Time Time Current
6:25:53 PM: Dload Upload Total Spent Left Speed
6:25:53 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
6:25:53 PM: 100 85 100 85 0 0 1666 0 --:–:-- --:–:-- --:–:-- 1666
6:25:53 PM: 100 99 100 99 0 0 1253 0 --:–:-- --:–:-- --:–:-- 1253
6:25:53 PM: 100 630 100 630 0 0 2985 0 --:–:-- --:–:-- --:–:-- 2985
6:25:53 PM: 100 832 100 832 0 0 3151 0 --:–:-- --:–:-- --:–:-- 3151
6:25:53 PM: > Verifying integrity…
6:25:53 PM: gpg: Signature made Fri 02 Oct 2020 11:17:27 AM UTC
6:25:53 PM: gpg: using RSA key 6D98490C6F1ACDDD448E45954F77679369475BAA
6:25:53 PM: gpg: Good signature from β€œYarn Packaging yarn@dan.cx” [unknown]
6:25:53 PM: gpg: WARNING: This key is not certified with a trusted signature!
6:25:53 PM: gpg: There is no indication that the signature belongs to the owner.
6:25:53 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
6:25:53 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
6:25:53 PM: > GPG signature looks good
6:25:53 PM: > Extracting to ~/.yarn…
6:25:53 PM: > Adding to $PATH…
6:25:53 PM: > Successfully installed Yarn 1.22.10! Please open another terminal where the yarn command will now be available.
6:25:54 PM: No yarn workspaces detected
6:25:54 PM: Started restoring cached node modules
6:25:54 PM: Finished restoring cached node modules
6:25:54 PM: Installing NPM modules using Yarn version 1.22.10
6:25:55 PM: yarn install v1.22.10
6:25:55 PM: [1/4] Resolving packages…
6:25:55 PM: [2/4] Fetching packages…
6:26:18 PM: info fsevents@2.3.2: The platform β€œlinux” is incompatible with this module.
6:26:18 PM: info β€œfsevents@2.3.2” is an optional dependency and failed compatibility check. Excluding it from installation.
6:26:18 PM: info fsevents@1.2.13: The platform β€œlinux” is incompatible with this module.
6:26:18 PM: info β€œfsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
6:26:18 PM: [3/4] Linking dependencies…
6:26:18 PM: warning " > @testing-library/user-event@12.8.3" has unmet peer dependency β€œ@testing-library/dom@>=7.21.4”.
6:26:33 PM: [4/4] Building fresh packages…
6:26:34 PM: Done in 39.92s.
6:26:35 PM: NPM modules installed using Yarn
6:26:35 PM: Started restoring cached go cache
6:26:35 PM: Finished restoring cached go cache
6:26:35 PM: go version go1.16.5 linux/amd64
6:26:35 PM: go version go1.16.5 linux/amd64
6:26:35 PM: Installing missing commands
6:26:35 PM: Verify run directory
6:26:36 PM: ​
6:26:36 PM: ────────────────────────────────────────────────────────────────
6:26:36 PM: Netlify Build
6:26:36 PM: ────────────────────────────────────────────────────────────────
6:26:36 PM: ​
6:26:36 PM: ❯ Version
6:26:36 PM: @netlify/build 18.13.6
6:26:36 PM: ​
6:26:36 PM: ❯ Flags
6:26:36 PM: baseRelDir: true
6:26:36 PM: buildId: 6155f3161f503d4da9097995
6:26:36 PM: deployId: 6155f3161f503d4da9097997
6:26:36 PM: ​
6:26:36 PM: ❯ Current directory
6:26:36 PM: /opt/build/repo
6:26:36 PM: ​
6:26:36 PM: ❯ Config file
6:26:36 PM: No config file was defined: using default values.
6:26:36 PM: ​
6:26:36 PM: ❯ Context
6:26:36 PM: production
6:26:36 PM: ​
6:26:36 PM: ────────────────────────────────────────────────────────────────
6:26:36 PM: 1. Build command from Netlify app
6:26:36 PM: ────────────────────────────────────────────────────────────────
6:26:36 PM: ​
6:26:36 PM: $ yarn build
6:26:36 PM: yarn run v1.22.10
6:26:36 PM: $ react-scripts build
6:26:38 PM: (node:1548) [DEP0148] DeprecationWarning: Use of deprecated folder mapping β€œ./” in the β€œexports” field module resolution of the package at /opt/build/repo/node_modules/postcss-safe-parser/node_modules/postcss/package.json.
6:26:38 PM: Update this package.json to use a subpath pattern like β€œ./*”.
6:26:38 PM: (Use node --trace-deprecation ... to show where the warning was created)
6:26:38 PM: Creating an optimized production build…
6:26:48 PM: Failed to compile.
6:26:48 PM:
6:26:48 PM: ./src/utils/exports/assets.ts
6:26:48 PM: Cannot find file β€˜β€¦/…/./assets/images/logos.png’ in β€˜./src/utils/exports’.
6:26:48 PM: error Command failed with exit code 1.
6:26:48 PM: info Visit yarn run | Yarn for documentation about this command.
6:26:48 PM: ​
6:26:48 PM: ────────────────────────────────────────────────────────────────
6:26:48 PM: β€œbuild.command” failed
6:26:48 PM: ────────────────────────────────────────────────────────────────
6:26:48 PM: ​
6:26:48 PM: Error message
6:26:48 PM: Command failed with exit code 1: yarn build
6:26:48 PM: ​
6:26:48 PM: Error location
6:26:48 PM: In Build command from Netlify app:
6:26:48 PM: yarn build
6:26:48 PM: ​
6:26:48 PM: Resolved config
6:26:48 PM: build:
6:26:48 PM: command: yarn build
6:26:48 PM: commandOrigin: ui
6:26:48 PM: publish: /opt/build/repo/build
6:26:48 PM: publishOrigin: ui
6:26:48 PM: Caching artifacts
6:26:48 PM: Started saving node modules
6:26:48 PM: Finished saving node modules
6:26:48 PM: Started saving build plugins
6:26:48 PM: Finished saving build plugins
6:26:48 PM: Started saving yarn cache
6:26:54 PM: Finished saving yarn cache
6:26:54 PM: Started saving pip cache
6:26:54 PM: Finished saving pip cache
6:26:54 PM: Started saving emacs cask dependencies
6:26:54 PM: Finished saving emacs cask dependencies
6:26:54 PM: Started saving maven dependencies
6:26:54 PM: Finished saving maven dependencies
6:26:54 PM: Started saving boot dependencies
6:26:54 PM: Finished saving boot dependencies
6:26:54 PM: Started saving rust rustup cache
6:26:54 PM: Finished saving rust rustup cache
6:26:54 PM: Started saving go dependencies
6:26:54 PM: Finished saving go dependencies
6:26:56 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:26:56 PM: Creating deploy upload records
6:26:56 PM: Failing build: Failed to build site
6:26:56 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
6:26:56 PM: Finished processing build request in 1m12.664777649s

Hi there, @GaadMaiyaki :wave:

Thanks for reaching out. I believe you are encountering this issue:

Please read through that thread and respond there if you have additional related questions or concerns. In order to streamline communication, I will be closing our current thread together.

Our Support Team put together a guide for mitigating this issue in the meantime. I encourage you to read this as well and see if the steps are applicable to your use case:

Thank you.