In my project, I use ‘react-markdown’ to display some markdown files on component. When I deploy on Netlify, I got this error.
PLEASE help me to understand and give a solution to this Deploy error. Thanks
Deploy log
────────────────────────────────────────────────────────────────
5:17:15 PM: 1. Build command from Netlify app
5:17:15 PM: ────────────────────────────────────────────────────────────────
5:17:15 PM:
5:17:15 PM: $ yarn build
5:17:15 PM: yarn run v1.22.10
5:17:15 PM: $ react-scripts build
5:17:17 PM: Creating an optimized production build…
5:17:18 PM: Failed to compile.
5:17:18 PM:
5:17:18 PM: Module not found: Error: Can’t resolve ‘…/assets/markdown/javascript/JavaScript.md’ in ‘/opt/build/repo/src/routes’
5:17:18 PM: error Command failed with exit code 1. (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
5:17:18 PM: info Visit yarn run | Yarn for documentation about this command.
5:17:18 PM:
5:17:18 PM: ────────────────────────────────────────────────────────────────
5:17:18 PM: “build.command” failed
5:17:18 PM: ────────────────────────────────────────────────────────────────
5:17:18 PM:
5:17:18 PM: Error message
5:17:18 PM: Command failed with exit code 1: yarn build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
5:17:18 PM:
5:17:18 PM: Error location
5:17:18 PM: In Build command from Netlify app:
5:17:18 PM: yarn build
5:17:18 PM:
5:17:18 PM: Resolved config
5:17:18 PM: build:
5:17:18 PM: command: yarn build
5:17:18 PM: commandOrigin: ui
5:17:18 PM: publish: /opt/build/repo/build
5:17:18 PM: publishOrigin: ui
5:17:19 PM: Caching artifacts
5:17:19 PM: Started saving node modules
5:17:19 PM: Finished saving node modules
5:17:19 PM: Started saving build plugins
5:17:19 PM: Finished saving build plugins
5:17:19 PM: Started saving yarn cache
5:17:24 PM: Finished saving yarn cache
5:17:24 PM: Started saving pip cache
5:17:24 PM: Finished saving pip cache
5:17:24 PM: Started saving emacs cask dependencies
5:17:24 PM: Finished saving emacs cask dependencies
5:17:24 PM: Started saving maven dependencies
5:17:24 PM: Finished saving maven dependencies
5:17:24 PM: Started saving boot dependencies
5:17:24 PM: Finished saving boot dependencies
5:17:24 PM: Started saving rust rustup cache
5:17:24 PM: Finished saving rust rustup cache
5:17:24 PM: Started saving go dependencies
5:17:24 PM: Finished saving go dependencies
5:17:25 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:17:25 PM: Creating deploy upload records
5:17:26 PM: Failing build: Failed to build site
5:17:26 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
5:17:26 PM: Finished processing build request in 48.39328787s