Netlify build error after implementing sub repo

PLEASE help us help you by writing a good post!

Hi there this is my website name https://gemeente-rotterbosch-blog.netlify.app/
this is the build log
10:47:56 AM: build-image version: d7b3813f01c06610bc1723ff1b22446513ee7941 (focal)
10:47:56 AM: build-image tag: v4.14.3
10:47:56 AM: buildbot version: be0925a1b4e8f8d2c5a767f3e0decf8856cad273
10:47:56 AM: Building without cache
10:47:56 AM: Starting to prepare the repo for build
10:47:57 AM: No cached dependencies found. Cloning fresh repo
10:47:57 AM: git clone GitHub - YasinCap/Rotterbosch_blog
10:47:58 AM: Preparing Git Reference refs/heads/main
10:48:00 AM: Parsing package.json dependencies
10:48:02 AM: Starting build script
10:48:02 AM: Installing dependencies
10:48:02 AM: Python version set to 2.7
10:48:02 AM: Downloading and installing node v16.18.1…
10:48:02 AM: Downloading https://nodejs.org/dist/v16.18.1/node-v16.18.1-linux-x64.tar.xz…
10:48:03 AM: Computing checksum with sha256sum
10:48:04 AM: Checksums matched!
10:48:06 AM: Now using node v16.18.1 (npm v8.19.2)
10:48:06 AM: Enabling node corepack
10:48:06 AM: Started restoring cached build plugins
10:48:06 AM: Finished restoring cached build plugins
10:48:06 AM: Attempting ruby version 2.7.2, read from environment
10:48:07 AM: Using ruby version 2.7.2
10:48:07 AM: Using PHP version 8.0
10:48:07 AM: No npm workspaces detected
10:48:07 AM: Started restoring cached node modules
10:48:07 AM: Finished restoring cached node modules
10:48:07 AM: Installing NPM modules using NPM version 8.19.2
10:48:11 AM: added 43 packages, and audited 44 packages in 3s
10:48:11 AM: 10 packages are looking for funding
10:48:11 AM: run npm fund for details
10:48:11 AM: found 0 vulnerabilities
10:48:11 AM: NPM modules installed
10:48:11 AM: Creating package sha
10:48:11 AM: Started restoring cached go cache
10:48:11 AM: Finished restoring cached go cache
10:48:11 AM: Installing Go version 1.17 (requested 1.17)
10:48:15 AM: unset GOOS;
10:48:15 AM: unset GOARCH;
10:48:15 AM: export GOROOT=β€˜/opt/buildhome/.gimme/versions/go1.17.linux.amd64’;
10:48:15 AM: export PATH=β€œ/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}”;
10:48:15 AM: go version >&2;
10:48:15 AM: export GIMME_ENV=β€œ/opt/buildhome/.gimme/env/go1.17.linux.amd64.env”
10:48:15 AM: go version go1.17 linux/amd64
10:48:15 AM: Detected 1 framework(s)
10:48:15 AM: β€œnext” at version β€œ13.0.1”
10:48:15 AM: Installing missing commands
10:48:15 AM: Verify run directory
10:48:17 AM: ​
10:48:17 AM: ────────────────────────────────────────────────────────────────
10:48:17 AM: Netlify Build
10:48:17 AM: ────────────────────────────────────────────────────────────────
10:48:17 AM: ​
10:48:17 AM: ❯ Version
10:48:17 AM: @netlify/build 28.1.13
10:48:17 AM: ​
10:48:17 AM: ❯ Flags
10:48:17 AM: baseRelDir: true
10:48:17 AM: buildId: 63720ecaf5116b1381a0b003
10:48:17 AM: deployId: 63720ecaf5116b1381a0b005
10:48:17 AM: ​
10:48:17 AM: ❯ Current directory
10:48:17 AM: /opt/build/repo
10:48:17 AM: ​
10:48:17 AM: ❯ Config file
10:48:17 AM: No config file was defined: using default values.
10:48:17 AM: ​
10:48:17 AM: ❯ Context
10:48:17 AM: production
10:48:17 AM: ​
10:48:17 AM: ❯ Installing plugins
10:48:17 AM: - @netlify/plugin-nextjs@4.28.6
10:48:26 AM: ​
10:48:26 AM: ❯ Using Next.js Runtime - v4.28.6
10:48:27 AM: ​
10:48:27 AM: ────────────────────────────────────────────────────────────────
10:48:27 AM: 1. @netlify/plugin-nextjs (onPreBuild event)
10:48:27 AM: ────────────────────────────────────────────────────────────────
10:48:27 AM: ​
10:48:27 AM: No Next.js cache to restore.
10:48:27 AM: Netlify configuration property β€œbuild.environment.NEXT_PRIVATE_TARGET” value changed.
10:48:27 AM: ​
10:48:27 AM: (@netlify/plugin-nextjs onPreBuild completed in 15ms)
10:48:27 AM: ​
10:48:27 AM: ────────────────────────────────────────────────────────────────
10:48:27 AM: 2. Build command from Netlify app
10:48:27 AM: ────────────────────────────────────────────────────────────────
10:48:27 AM: ​
10:48:27 AM: $ npm run build
10:48:27 AM: > rotterbosch-blog@0.1.0 build
10:48:27 AM: > next build
10:48:28 AM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: no-cache | Next.js
10:48:28 AM: info - Linting and checking validity of types…
10:48:29 AM: info - Creating an optimized production build…
10:48:31 AM: Failed to compile.
10:48:31 AM:
10:48:31 AM: ./components/components/src/stories/Button.jsx
10:48:31 AM: Module not found: Can’t resolve β€˜prop-types’ in β€˜/opt/build/repo/components/components/src/stories’
10:48:31 AM: Import trace for requested module:
10:48:31 AM: ./components/components/src/stories/Button.jsx
10:48:31 AM: > Build failed because of webpack errors
10:48:31 AM: ​
10:48:31 AM: ────────────────────────────────────────────────────────────────
10:48:31 AM: β€œbuild.command” failed
10:48:31 AM: ────────────────────────────────────────────────────────────────
10:48:31 AM: ​
10:48:31 AM: Error message
10:48:31 AM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
10:48:31 AM: ​
10:48:31 AM: Error location
10:48:31 AM: In Build command from Netlify app:
10:48:31 AM: npm run build
10:48:31 AM: ​
10:48:31 AM: Resolved config
10:48:31 AM: build:
10:48:31 AM: command: npm run build
10:48:31 AM: commandOrigin: ui
10:48:31 AM: environment:
10:48:31 AM: - CONTENTFUL_ACCESS_KEY
10:48:31 AM: - CONTENTFUL_SPACE_ID
10:48:31 AM: - NEXT_PRIVATE_TARGET
10:48:31 AM: publish: /opt/build/repo/.next
10:48:31 AM: publishOrigin: ui
10:48:31 AM: plugins:
10:48:31 AM: - inputs: {}
10:48:31 AM: origin: ui
10:48:31 AM: package: β€˜@netlify/plugin-nextjs’
10:48:31 AM: Caching artifacts
10:48:31 AM: Started saving node modules
10:48:31 AM: Finished saving node modules
10:48:31 AM: Started saving build plugins
10:48:31 AM: Finished saving build plugins
10:48:31 AM: Started saving pip cache
10:48:31 AM: Finished saving pip cache
10:48:31 AM: Started saving emacs cask dependencies
10:48:31 AM: Finished saving emacs cask dependencies
10:48:31 AM: Started saving maven dependencies
10:48:33 AM: Creating deploy upload records
10:48:31 AM: Finished saving maven dependencies
10:48:31 AM: Started saving boot dependencies
10:48:31 AM: Finished saving boot dependencies
10:48:31 AM: Started saving rust rustup cache
10:48:33 AM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
10:48:31 AM: Finished saving rust rustup cache
10:48:31 AM: Started saving go dependencies
10:48:31 AM: Finished saving go dependencies
10:48:33 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:48:33 AM: Failing build: Failed to build site
10:48:33 AM: Finished processing build request in 36.655664232s

It used to build, but now it does not anymore, since I added a sub repo in my main repository.

For anyone stuck with the same problem npm install --save prop-types worked!

2 Likes