LOGS"
6:13:13 PM: Netlify Build
6:13:13 PM: ────────────────────────────────────────────────────────────────
6:13:13 PM:
6:13:13 PM: ❯ Version
6:13:13 PM: @netlify/build 29.58.9
6:13:13 PM:
6:13:13 PM: ❯ Flags
6:13:13 PM: accountId: 67b972743601bffd165f5ac3
6:13:13 PM: baseRelDir: true
6:13:13 PM: buildId: 67bb029c3a33fd0008000378
6:13:13 PM: deployId: 67bb029c3a33fd000800037a
6:13:14 PM:
6:13:14 PM: ❯ Current directory
6:13:14 PM: /opt/build/repo
6:13:14 PM:
6:13:14 PM: ❯ Config file
6:13:14 PM: /opt/build/repo/netlify.toml
6:13:14 PM:
6:13:14 PM: ❯ Context
6:13:14 PM: production
6:13:14 PM:
6:13:14 PM: ❯ Using Next.js Runtime - v5.9.4
6:13:16 PM: No Next.js cache to restore
6:13:16 PM:
6:13:16 PM: Build command from Netlify app
6:13:16 PM: ────────────────────────────────────────────────────────────────
6:13:16 PM:
6:13:16 PM: $ next build
6:13:16 PM: No build cache found. Please configure build caching for faster rebuilds. Read more: No Cache Detected | Next.js
6:13:17 PM: ▲ Next.js 15.1.3
6:13:17 PM: Creating an optimized production build …
6:13:21 PM: Failed to compile.
6:13:21 PM:
6:13:21 PM: ./src/widgets/Header/index.tsx
6:13:21 PM: Module not found: Can’t resolve ‘…/MainSearchModal’
6:13:21 PM: Module Not Found | Next.js
6:13:21 PM: > Build failed because of webpack errors
6:13:22 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
6:13:22 PM:
6:13:22 PM: “build.command” failed
6:13:22 PM: ────────────────────────────────────────────────────────────────
6:13:22 PM:
6:13:22 PM: Error message
6:13:22 PM: Command failed with exit code 1: next build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
6:13:22 PM:
6:13:22 PM: Error location
6:13:22 PM: In Build command from Netlify app:
6:13:22 PM: next build
6:13:22 PM:
6:13:22 PM: Resolved config
6:13:22 PM: build:
6:13:22 PM: command: next build
6:13:22 PM: commandOrigin: ui
6:13:22 PM: publish: /opt/build/repo
6:13:22 PM: publishOrigin: default
6:13:22 PM: plugins:
6:13:22 PM: - inputs: {}
6:13:22 PM: origin: config
6:13:22 PM: package: ‘@netlify/plugin-nextjs’
6:13:22 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:13:22 PM: Failing build: Failed to build site
6:13:22 PM: Finished processing build request in 45.362s
When deploying locally via nfs run build, as well as during development, I have no errors 6:13:21 PM: Module not found: Can’t resolve ‘…/MainSearchModal’