Home
Support Forums

Problem with deploy

Hey everybody,

I’m having some issues trying to deploy a Next.js website I built. I’m interested to know what you think might be the problem

12:44:17 PM: Build ready to start
12:44:19 PM: build-image version: c5b01a919d3e16af69445c5de0cacb49efbb1a23 (focal)
12:44:19 PM: build-image tag: v4.4.0
12:44:19 PM: buildbot version: 9deea8f876b3228119111d3a654f519dd1866bfe
12:44:19 PM: Fetching cached dependencies
12:44:19 PM: Failed to fetch cache, continuing with build
12:44:19 PM: Starting to prepare the repo for build
12:44:20 PM: No cached dependencies found. Cloning fresh repo
12:44:20 PM: git clone git@gitlab.com:branded-landing-pages/nessco
12:45:29 PM: Preparing Git Reference refs/heads/dev-ella
12:45:31 PM: Parsing package.json dependencies
12:45:31 PM: Starting build script
12:45:31 PM: Installing dependencies
12:45:31 PM: Python version set to 2.7
12:45:32 PM: Downloading and installing node v16.13.0…
12:45:32 PM: Downloading https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz
12:45:32 PM: Computing checksum with sha256sum
12:45:32 PM: Checksums matched!
12:45:35 PM: Now using node v16.13.0 (npm v8.1.0)
12:45:35 PM: Started restoring cached build plugins
12:45:35 PM: Finished restoring cached build plugins
12:45:35 PM: Attempting ruby version 2.7.2, read from environment
12:45:36 PM: Using ruby version 2.7.2
12:45:37 PM: Using PHP version 8.0
12:45:37 PM: Started restoring cached node modules
12:45:37 PM: Finished restoring cached node modules
12:45:37 PM: Installing NPM modules using NPM version 8.1.0
12:45:44 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
12:45:48 PM: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
12:45:50 PM: added 566 packages, and audited 567 packages in 13s
12:45:50 PM: 89 packages are looking for funding
12:45:50 PM: run npm fund for details
12:45:50 PM: found 0 vulnerabilities
12:45:50 PM: NPM modules installed
12:45:51 PM: Started restoring cached go cache
12:45:51 PM: Finished restoring cached go cache
12:45:51 PM: go version go1.16.5 linux/amd64
12:45:51 PM: go version go1.16.5 linux/amd64
12:45:51 PM: Installing missing commands
12:45:51 PM: Verify run directory
12:45:52 PM: ​
12:45:52 PM: ────────────────────────────────────────────────────────────────
12:45:52 PM: Netlify Build
12:45:52 PM: ────────────────────────────────────────────────────────────────
12:45:52 PM: ​
12:45:52 PM: ❯ Version
12:45:52 PM: @netlify/build 18.20.1
12:45:52 PM: ​
12:45:52 PM: ❯ Flags
12:45:52 PM: baseRelDir: true
12:45:52 PM: buildId: 617e738197042dc87dc0b186
12:45:52 PM: deployId: 617e738197042dc87dc0b188
12:45:52 PM: ​
12:45:52 PM: ❯ Current directory
12:45:52 PM: /opt/build/repo
12:45:52 PM: ​
12:45:52 PM: ❯ Config file
12:45:52 PM: No config file was defined: using default values.
12:45:52 PM: ​
12:45:52 PM: ❯ Context
12:45:52 PM: production
12:45:52 PM: ​
12:45:52 PM: ❯ Installing plugins
12:45:52 PM: - @netlify/plugin-nextjs@3.9.2
12:46:02 PM: ​
12:46:02 PM: ❯ Loading plugins
12:46:02 PM: - @netlify/plugin-nextjs@3.9.2 from Netlify app
12:46:03 PM: ​
12:46:03 PM: ────────────────────────────────────────────────────────────────
12:46:03 PM: 1. @netlify/plugin-nextjs (onPreBuild event)
12:46:03 PM: ────────────────────────────────────────────────────────────────
12:46:03 PM: ​
12:46:03 PM: Using Next.js 11.1.2
12:46:03 PM: Warning: support for Next.js >=11.1.0 is experimental
12:46:03 PM: info - Using webpack 5. Reason: Enabled by default webpack5 | Next.js
12:46:03 PM: The “target” config property must be one of “serverless”, “experimental-serverless-trace”. Building with “serverless” target.
12:46:03 PM: info - Using webpack 5. Reason: Enabled by default webpack5 | Next.js
12:46:04 PM: No Next.js cache to restore.
12:46:04 PM: ​
12:46:04 PM: (@netlify/plugin-nextjs onPreBuild completed in 1s)
12:46:04 PM: ​
12:46:04 PM: ────────────────────────────────────────────────────────────────
12:46:04 PM: 2. Build command from Netlify app
12:46:04 PM: ────────────────────────────────────────────────────────────────
12:46:04 PM: ​
12:46:04 PM: $ next build
12:46:04 PM: info - Using webpack 5. Reason: Enabled by default webpack5 | Next.js
12:46:05 PM: info - Checking validity of types…
12:46:05 PM: warn - No ESLint configuration detected. Run next lint to begin setup
12:46:05 PM: info - Creating an optimized production build…
12:46:38 PM: (node:1673) [DEP_WEBPACK_CHUNK_HAS_ENTRY_MODULE] DeprecationWarning: Chunk.hasEntryModule: Use new ChunkGraph API
12:46:38 PM: (Use node --trace-deprecation ... to show where the warning was created)
12:46:40 PM: warn - Compiled with warnings
12:46:40 PM: ./node_modules/next/dist/server/load-components.js
12:46:40 PM: Critical dependency: the request of a dependency is an expression
12:46:40 PM: ./node_modules/next/dist/server/load-components.js
12:46:40 PM: Critical dependency: the request of a dependency is an expression
12:46:40 PM: ./node_modules/next/dist/server/load-components.js
12:46:40 PM: Critical dependency: the request of a dependency is an expression
12:46:40 PM: ./node_modules/next/dist/server/require.js
12:46:40 PM: Critical dependency: the request of a dependency is an expression
12:46:40 PM: ./node_modules/next/dist/server/require.js
12:46:40 PM: Critical dependency: the request of a dependency is an expression
12:46:40 PM: ./node_modules/next/dist/server/require.js
12:46:40 PM: Critical dependency: the request of a dependency is an expression
12:46:40 PM: info - Collecting page data…
12:46:42 PM: > Build error occurred
12:46:42 PM: Error: Build optimization failed: found pages without a React Component as default export in
12:46:42 PM: pages/contact/contactSchema
12:46:42 PM: pages/contactSchemaMain
12:46:42 PM: See page-without-valid-component | Next.js for more info.
12:46:42 PM: at /opt/build/repo/node_modules/next/dist/build/index.js:674:19
12:46:42 PM: at runMicrotasks ()
12:46:42 PM: at processTicksAndRejections (node:internal/process/task_queues:96:5)
12:46:42 PM: at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:60:20)
12:46:42 PM: at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:77:25)
12:46:42 PM: ​
12:46:42 PM: ────────────────────────────────────────────────────────────────
12:46:42 PM: “build.command” failed
12:46:42 PM: ────────────────────────────────────────────────────────────────
12:46:42 PM: ​
12:46:42 PM: Error message
12:46:42 PM: Command failed with exit code 1: next build
12:46:42 PM: ​
12:46:42 PM: Error location
12:46:42 PM: In Build command from Netlify app:
12:46:42 PM: next build
12:46:42 PM: ​
12:46:42 PM: Resolved config
12:46:42 PM: build:
12:46:42 PM: command: next build
12:46:42 PM: commandOrigin: ui
12:46:42 PM: publish: /opt/build/repo/out
12:46:42 PM: publishOrigin: ui
12:46:42 PM: plugins:
12:46:42 PM: - inputs: {}
12:46:42 PM: origin: ui
12:46:42 PM: package: ‘@netlify/plugin-nextjs’
12:46:43 PM: Caching artifacts
12:46:43 PM: Started saving node modules
12:46:43 PM: Finished saving node modules
12:46:43 PM: Started saving build plugins
12:46:43 PM: Finished saving build plugins
12:46:43 PM: Started saving pip cache
12:46:43 PM: Finished saving pip cache
12:46:43 PM: Started saving emacs cask dependencies
12:46:43 PM: Finished saving emacs cask dependencies
12:46:43 PM: Started saving maven dependencies
12:46:43 PM: Finished saving maven dependencies
12:46:43 PM: Started saving boot dependencies
12:46:43 PM: Finished saving boot dependencies
12:46:43 PM: Started saving rust rustup cache
12:46:43 PM: Finished saving rust rustup cache
12:46:43 PM: Started saving go dependencies
12:46:43 PM: Finished saving go dependencies
12:46:45 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:46:45 PM: Creating deploy upload records
12:46:45 PM: Failing build: Failed to build site
12:46:45 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
12:46:45 PM: Finished processing build request in 2m26.301059062s

Could you check to solve what these lines suggest?

2 Likes