5:24:37 PM: build-image version: 900a223ea0f4a600c43255115089305a2b808649 (focal)
5:24:37 PM: buildbot version: 900a223ea0f4a600c43255115089305a2b808649
5:24:37 PM: Building without cache
5:24:37 PM: Starting to prepare the repo for build
5:24:37 PM: No cached dependencies found. Cloning fresh repo
5:24:37 PM: git clone --filter=blob:none https://github.com/jm4rcos/client-delivery-app
5:24:38 PM: Preparing Git Reference refs/heads/main
5:24:50 PM: Parsing package.json dependencies
5:24:52 PM: Starting to install dependencies
5:24:52 PM: Python version set to 3.8
5:24:52 PM: Attempting Ruby version 2.7.2, read from environment
5:24:52 PM: Using Ruby version 2.7.2
5:24:53 PM: Started restoring cached go cache
5:24:53 PM: Finished restoring cached go cache
5:24:53 PM: Installing Go version 1.19.5 (requested 1.19.5)
5:24:58 PM: go version go1.19.5 linux/amd64
5:24:58 PM: Using PHP version 8.0
5:24:59 PM: v16.20.0 is already installed.
5:25:00 PM: Now using node v16.20.0 (npm v8.19.4)
5:25:00 PM: Enabling Node.js Corepack
5:25:00 PM: Started restoring cached build plugins
5:25:00 PM: Finished restoring cached build plugins
5:25:00 PM: Started restoring cached corepack dependencies
5:25:00 PM: Finished restoring cached corepack dependencies
5:25:00 PM: No npm workspaces detected
5:25:00 PM: Started restoring cached node modules
5:25:00 PM: Finished restoring cached node modules
5:25:00 PM: Installing npm packages using npm version 8.19.4
5:25:10 PM: added 410 packages, and audited 411 packages in 9s
5:25:10 PM: 50 packages are looking for funding
5:25:10 PM: run npm fund
for details
5:25:10 PM: found 0 vulnerabilities
5:25:10 PM: npm packages installed
5:25:10 PM: Install dependencies script success
5:25:10 PM: Starting build script
5:25:11 PM: Detected 1 framework(s)
5:25:11 PM: βnextβ at version β13.3.0β
5:25:11 PM: Section completed: initializing
5:25:12 PM: β
5:25:12 PM: Netlify Build
5:25:12 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
5:25:12 PM: β
5:25:12 PM: β― Version
5:25:12 PM: @netlify/build 29.11.1
5:25:12 PM: β
5:25:12 PM: β― Flags
5:25:12 PM: baseRelDir: true
5:25:12 PM: buildId: 64595a819ce15228f2a16b3a
5:25:12 PM: deployId: 64595a819ce15228f2a16b3c
5:25:12 PM: β
5:25:12 PM: β― Current directory
5:25:12 PM: /opt/build/repo
5:25:12 PM: β
5:25:12 PM: β― Config file
5:25:12 PM: No config file was defined: using default values.
5:25:12 PM: β
5:25:12 PM: β― Context
5:25:12 PM: production
5:25:12 PM: β
5:25:12 PM: β― Using Next.js Runtime - v4.29.5-appdir.0
5:25:12 PM: β
5:25:12 PM: β― Outdated plugins
5:25:12 PM: - @netlify/plugin-nextjs@4.29.5-appdir.0: latest version is 4.36.0
5:25:12 PM: Migration guide: GitHub - netlify/next-runtime: The Next.js Runtime allows Next.js to run on Netlify with zero configuration
5:25:12 PM: To upgrade this plugin, please update its version in βpackage.jsonβ
5:25:14 PM: β
5:25:14 PM: @netlify/plugin-nextjs (onPreBuild event)
5:25:14 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
5:25:14 PM: β
5:25:14 PM: No Next.js cache to restore.
5:25:14 PM: Netlify configuration property βbuild.environment.NEXT_PRIVATE_TARGETβ value changed.
5:25:14 PM: β
5:25:14 PM: (@netlify/plugin-nextjs onPreBuild completed in 19ms)
5:25:14 PM: β
5:25:14 PM: Build command from Netlify app
5:25:14 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
5:25:14 PM: β
5:25:14 PM: $ npm run build
5:25:14 PM: > front-end-app-delivery@0.1.0 build
5:25:14 PM: > next build
5:25:15 PM: info - Linting and checking validity of typesβ¦
5:25:19 PM: info - Creating an optimized production buildβ¦
5:25:32 PM: info - Compiled successfully
5:25:32 PM: info - Collecting page dataβ¦
5:25:37 PM: > Build optimization failed: found pages without a React Component as default export in
5:25:37 PM: pages/store/ModalState
5:25:37 PM: pages/store/SidebarState
5:25:37 PM: pages/store
5:25:37 PM: pages/dashboard/history/styles
5:25:37 PM: pages/dashboard/manage/styles
5:25:37 PM: pages/dashboard/styles
5:25:37 PM: pages/login/login-form-style
5:25:37 PM: pages/menu/styles
5:25:37 PM: pages/dashboard/establishment/styles
5:25:37 PM: pages/landing/styles
5:25:37 PM: pages/store/AddToCart
5:25:37 PM: pages/dashboard/settings/styles
5:25:37 PM: pages/store/AuthState
5:25:37 PM: pages/dashboard/orders/styles
5:25:37 PM: pages/register/styles
5:25:37 PM: pages/checkout/styles
5:25:37 PM: See page-without-valid-component | Next.js for more info.
5:25:37 PM: β
5:25:37 PM: βbuild.commandβ failed
5:25:37 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
5:25:37 PM: β
5:25:37 PM: Error message
5:25:37 PM: Command failed with exit code 1: npm run build
5:25:37 PM: β
5:25:37 PM: Error location
5:25:37 PM: In Build command from Netlify app:
5:25:37 PM: npm run build
5:25:37 PM: β
5:25:37 PM: Resolved config
5:25:37 PM: build:
5:25:37 PM: command: npm run build
5:25:37 PM: commandOrigin: ui
5:25:37 PM: environment:
5:25:37 PM: - NEXT_PRIVATE_TARGET
5:25:37 PM: publish: /opt/build/repo/.next
5:25:39 PM: Failed during stage βbuilding siteβ: Build script returned non-zero exit code: 2
5:25:37 PM: publishOrigin: ui
5:25:37 PM: plugins:
5:25:37 PM: - inputs: {}
5:25:37 PM: origin: ui
5:25:37 PM: package: β@netlify/plugin-nextjsβ
5:25:38 PM: Caching artifacts
5:25:38 PM: Started saving node modules
5:25:38 PM: Finished saving node modules
5:25:38 PM: Started saving build plugins
5:25:38 PM: Finished saving build plugins
5:25:38 PM: Started saving corepack cache
5:25:38 PM: Finished saving corepack cache
5:25:38 PM: Started saving pip cache
5:25:38 PM: Finished saving pip cache
5:25:38 PM: Started saving emacs cask dependencies
5:25:38 PM: Finished saving emacs cask dependencies
5:25:38 PM: Started saving maven dependencies
5:25:38 PM: Finished saving maven dependencies
5:25:38 PM: Started saving boot dependencies
5:25:38 PM: Finished saving boot dependencies
5:25:38 PM: Started saving rust rustup cache
5:25:38 PM: Finished saving rust rustup cache
5:25:38 PM: Started saving go dependencies
5:25:38 PM: Finished saving go dependencies
5:25:39 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:25:39 PM: Failing build: Failed to build site
5:25:39 PM: Finished processing build request in 1m2.316s
I also tried:
[build]
command = βnpm run buildβ
publish = β.nextβ
in my root but it was a similar issue.
Runtime
Next.js
Base directory
Not set
Build command
npm run build
Publish directory
.next
What am I missing here? When I try to npm run build locally it builds with no issues.