Home
Support Forums

Netlify + Next.js

Hello, I am trying to deploy my website, but it now all of a sudden is not working. It had been previously working and I even tried redeploying an older branch from git, but I am still running into an error. I am attaching the log below.

5:28:27 PM: Build ready to start
5:28:29 PM: build-image version: 3bcb38c35508b42e9121d4badfe6d8c66fd7a3f0
5:28:29 PM: build-image tag: v4.3.2
5:28:29 PM: buildbot version: d82977f5ab056e59cd416c94ab05ba0d449dc63a
5:28:29 PM: Fetching cached dependencies
5:28:29 PM: Starting to download cache of 211.9MB
5:28:30 PM: Finished downloading cache in 1.33717041s
5:28:30 PM: Starting to extract cache
5:28:38 PM: Finished extracting cache in 7.906844094s
5:28:38 PM: Finished fetching cache in 9.339507673s
5:28:38 PM: Starting to prepare the repo for build
5:28:39 PM: Preparing Git Reference refs/heads/master
5:28:40 PM: Parsing package.json dependencies
5:28:41 PM: Starting build script
5:28:41 PM: Installing dependencies
5:28:41 PM: Python version set to 2.7
5:28:41 PM: Started restoring cached node version
5:28:44 PM: Finished restoring cached node version
5:28:44 PM: Downloading and installing node v16.11.1...
5:28:44 PM: Downloading https://nodejs.org/dist/v16.11.1/node-v16.11.1-linux-x64.tar.xz...
5:28:45 PM: Computing checksum with sha256sum
5:28:45 PM: Checksums matched!
5:28:48 PM: Now using node v16.11.1 (npm v8.0.0)
5:28:48 PM: Started restoring cached build plugins
5:28:48 PM: Finished restoring cached build plugins
5:28:48 PM: Attempting ruby version 2.7.2, read from environment
5:28:49 PM: Using ruby version 2.7.2
5:28:50 PM: Using PHP version 8.0
5:28:50 PM: Started restoring cached node modules
5:28:50 PM: Finished restoring cached node modules
5:28:50 PM: Installing NPM modules using NPM version 8.0.0
5:28:52 PM: npm WARN old lockfile
5:28:52 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
5:28:52 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
5:28:52 PM: npm WARN old lockfile
5:28:52 PM: npm WARN old lockfile This is a one-time fix-up, please be patient...
5:28:52 PM: npm WARN old lockfile
5:29:06 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
5:29:21 PM: added 93 packages, removed 142 packages, changed 121 packages, and audited 1024 packages in 30s
5:29:21 PM: 200 packages are looking for funding
5:29:21 PM:   run `npm fund` for details
5:29:21 PM: 20 vulnerabilities (5 moderate, 15 high)
5:29:21 PM: To address issues that do not require attention, run:
5:29:21 PM:   npm audit fix
5:29:21 PM: To address all issues (including breaking changes), run:
5:29:21 PM:   npm audit fix --force
5:29:21 PM: Run `npm audit` for details.
5:29:21 PM: NPM modules installed
5:29:21 PM: Started restoring cached go cache
5:29:21 PM: Finished restoring cached go cache
5:29:21 PM: go version go1.16.5 linux/amd64
5:29:21 PM: go version go1.16.5 linux/amd64
5:29:21 PM: Installing missing commands
5:29:21 PM: Verify run directory
5:29:23 PM: ​
5:29:23 PM: ────────────────────────────────────────────────────────────────
5:29:23 PM:   Netlify Build                                                 
5:29:23 PM: ────────────────────────────────────────────────────────────────
5:29:23 PM: ​
5:29:23 PM: ❯ Version
5:29:23 PM:   @netlify/build 18.17.5
5:29:23 PM: ​
5:29:23 PM: ❯ Flags
5:29:23 PM:   baseRelDir: true
5:29:23 PM:   buildId: 616df50bfce7900008e56fa4
5:29:23 PM:   deployId: 616df50bfce7900008e56fa6
5:29:23 PM: ​
5:29:23 PM: ❯ Current directory
5:29:23 PM:   /opt/build/repo
5:29:23 PM: ​
5:29:23 PM: ❯ Config file
5:29:23 PM:   /opt/build/repo/netlify.toml
5:29:23 PM: ​
5:29:23 PM: ❯ Context
5:29:23 PM:   production
5:29:23 PM: ​
5:29:23 PM: ❯ Installing plugins
5:29:23 PM:    - @netlify/plugin-nextjs@3.9.2
5:29:24 PM: ​
5:29:24 PM: ❯ Loading plugins
5:29:24 PM:    - @netlify/plugin-nextjs@3.9.2 from Netlify app
5:29:25 PM: ​
5:29:25 PM: ────────────────────────────────────────────────────────────────
5:29:25 PM:   1. @netlify/plugin-nextjs (onPreBuild event)                  
5:29:25 PM: ────────────────────────────────────────────────────────────────
5:29:25 PM: ​
5:29:25 PM: Using Next.js 11.1.2
5:29:25 PM: Warning: support for Next.js >=11.1.0 is experimental
5:29:25 PM: NOTE: Static HTML export Next.js projects (projects that use `next export`) do not require most of this plugin. For these sites, this plugin *only* caches builds.
5:29:25 PM: ​
5:29:25 PM: (@netlify/plugin-nextjs onPreBuild completed in 18ms)
5:29:25 PM: ​
5:29:25 PM: ────────────────────────────────────────────────────────────────
5:29:25 PM:   2. build.command from netlify.toml                            
5:29:25 PM: ────────────────────────────────────────────────────────────────
5:29:25 PM: ​
5:29:25 PM: $ npm run build && npm run export
5:29:25 PM: > alloy-marketing@0.1.0 build
5:29:25 PM: > next build
5:29:26 PM: info  - Loaded env from /opt/build/repo/.env
5:29:26 PM: info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
5:29:26 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
5:29:26 PM: info  - Checking validity of types...
5:29:31 PM: ./pages/about-us.js
5:29:31 PM: 48:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 63:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 81:21  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 81:21  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:29:31 PM: 109:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./pages/author/[slug].js
5:29:31 PM: 57:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./pages/blog/[slug].js
5:29:31 PM: 47:43  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 63:11  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 110:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 126:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./pages/blog.js
5:29:31 PM: 50:27  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 50:27  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:29:31 PM: ./pages/expert/[slug].js
5:29:31 PM: 57:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./pages/how-it-works.js
5:29:31 PM: 59:19  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 59:19  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:29:31 PM: ./pages/our-promise.js
5:29:31 PM: 32:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 69:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 80:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./pages/symptoms/[slug].js
5:29:31 PM: 60:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 60:17  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:29:31 PM: 95:19  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 95:19  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:29:31 PM: ./pages/symptoms.js
5:29:31 PM: 49:27  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./components/AboutList.js
5:29:31 PM: 12:19  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./components/BlogList.js
5:29:31 PM: 24:25  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 24:25  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:29:31 PM: ./components/Footer.js
5:29:31 PM: 14:142  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./components/NavBar.js
5:29:31 PM: 36:19  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./components/NavBarTitle.js
5:29:31 PM: 13:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./components/ProductList.js
5:29:31 PM: 17:21  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./components/SymptomList.js
5:29:31 PM: 22:25  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 22:25  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:29:31 PM: ./components/TestimonialList.js
5:29:31 PM: 18:23  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: ./components/Upgrade.js
5:29:31 PM: 33:13  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:29:31 PM: 33:13  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:29:31 PM: info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
5:29:31 PM: info  - Creating an optimized production build...
5:29:31 PM: next-optimized-images ❯ WARNING!
5:29:31 PM: next-optimized-images ❯ No package found which can optimize images.
5:29:31 PM: next-optimized-images ❯ Starting from version 2 of next-optimized-images, all optimization is optional and you can choose which ones you want to use.
5:29:31 PM: next-optimized-images ❯ For help during the setup and installation, please read https://github.com/cyrilwanner/next-optimized-images#optimization-packages
5:29:31 PM: next-optimized-images ❯ If you recently updated from v1 to v2, please read https://github.com/cyrilwanner/next-optimized-images/blob/master/UPGRADING.md
5:29:31 PM: next-optimized-images ❯ If this is on purpose and you don't want this plugin to optimize the images, set the option `optimizeImages: false` to hide this warning.
5:29:41 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:29:41 PM: Recommendation: math.div(1, $rfs-rem-value)
5:29:41 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:29:41 PM:    β•·
5:29:41 PM: 49 β”‚   $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
5:29:41 PM:    β”‚                                                                         ^^^^^^^^^^^^^^^^^^
5:29:41 PM:    β•΅
5:29:41 PM:     styles/scss/bootstrap/vendor/_rfs.scss 49:73  @import
5:29:41 PM:     styles/scss/bootstrap/_mixins.scss 6:9        @import
5:29:41 PM:     styles/scss/alloy.scss 3:9                    root stylesheet
5:29:41 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:29:41 PM: Recommendation: math.div($rfs-base-font-size, $rfs-base-font-size * 0 + 1 / $rfs-rem-value)
5:29:41 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:29:41 PM:    β•·
5:29:41 PM: 49 β”‚   $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
5:29:41 PM:    β”‚                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5:29:41 PM:    β•΅
5:29:41 PM:     styles/scss/bootstrap/vendor/_rfs.scss 49:24  @import
5:29:41 PM:     styles/scss/bootstrap/_mixins.scss 6:9        @import
5:29:41 PM:     styles/scss/alloy.scss 3:9                    root stylesheet
5:29:41 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:29:41 PM: Recommendation: math.div($rfs-breakpoint, $rfs-breakpoint * 0 + 1)
5:29:41 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:29:41 PM:    β•·
5:29:41 PM: 57 β”‚   $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1);
5:29:41 PM:    β”‚                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5:29:41 PM:    β•΅
5:29:41 PM:     styles/scss/bootstrap/vendor/_rfs.scss 57:20  @import
5:29:41 PM:     styles/scss/bootstrap/_mixins.scss 6:9        @import
5:29:41 PM:     styles/scss/alloy.scss 3:9                    root stylesheet
5:29:42 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:29:42 PM: Recommendation: math.div($spacer, 2)
5:29:42 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:29:42 PM:     β•·
5:29:42 PM: 322 β”‚ $headings-margin-bottom:      $spacer / 2;
5:29:42 PM:     β”‚                               ^^^^^^^^^^^
5:29:42 PM:     β•΅
5:29:42 PM:     styles/scss/core/_variables.scss 322:31  @import
5:29:42 PM:     styles/scss/alloy.scss 6:9               root stylesheet
5:29:42 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:29:42 PM: Recommendation: math.div($input-padding-y, 2)
5:29:42 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:29:42 PM:     β•·
5:29:42 PM: 494 β”‚ $input-height-inner-quarter:            calc(#{$input-line-height * .25em} + #{$input-padding-y / 2}) !default;
5:29:42 PM:     β”‚                                                                                ^^^^^^^^^^^^^^^^^^^^
5:29:42 PM:     β•΅
5:29:42 PM:     styles/scss/bootstrap/_variables.scss 494:80  @import
5:29:42 PM:     styles/scss/bootstrap/bootstrap.scss 9:9      @import
5:29:42 PM:     styles/scss/alloy.scss 8:9                    root stylesheet
5:29:44 PM: WARNING: 66 repetitive deprecation warnings omitted.
5:30:10 PM: Failed to compile.
5:30:10 PM: 
5:30:10 PM: HookWebpackError: Maximum call stack size exceeded
5:30:10 PM: > Build error occurred
5:30:10 PM: Error: > Build failed because of webpack errors
5:30:10 PM:     at /opt/build/repo/node_modules/next/dist/build/index.js:397:19
5:30:10 PM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:60:20)
5:30:10 PM:     at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:77:25)
5:30:12 PM: ​
5:30:12 PM: ────────────────────────────────────────────────────────────────
5:30:12 PM:   "build.command" failed                                        
5:30:12 PM: ────────────────────────────────────────────────────────────────
5:30:12 PM: ​
5:30:12 PM:   Error message
5:30:12 PM:   Command failed with exit code 1: npm run build && npm run export
5:30:12 PM: ​
5:30:12 PM:   Error location
5:30:12 PM:   In build.command from netlify.toml:
5:30:12 PM:   npm run build && npm run export
5:30:12 PM: ​
5:30:12 PM:   Resolved config
5:30:12 PM:   build:
5:30:12 PM:     command: npm run build && npm run export
5:30:12 PM:     commandOrigin: config
5:30:12 PM:     publish: /opt/build/repo/out
5:30:12 PM:     publishOrigin: config
5:30:12 PM:   plugins:
5:30:12 PM:     - inputs: {}
5:30:12 PM:       origin: ui
5:30:12 PM:       package: '@netlify/plugin-nextjs'
5:30:12 PM: Caching artifacts
5:30:12 PM: Started saving node modules
5:30:12 PM: Finished saving node modules
5:30:12 PM: Started saving build plugins
5:30:12 PM: Finished saving build plugins
5:30:12 PM: Started saving pip cache
5:30:12 PM: Finished saving pip cache
5:30:12 PM: Started saving emacs cask dependencies
5:30:12 PM: Finished saving emacs cask dependencies
5:30:12 PM: Started saving maven dependencies
5:30:13 PM: Finished saving maven dependencies
5:30:13 PM: Started saving boot dependencies
5:30:13 PM: Finished saving boot dependencies
5:30:13 PM: Started saving rust rustup cache
5:30:13 PM: Finished saving rust rustup cache
5:30:13 PM: Started saving go dependencies
5:30:13 PM: Finished saving go dependencies

Hey there, @mikhail-myalloy :wave:

Thanks so much for reaching out. Can you please share your Netlify site name and your project repo? This will allow to look into this further.

Hello Hillary! I may not be able to share the repo but the link is https://alloy.netlify.app

hi there, does this compile locally?

Hello Perry, yes this compiles locally and exports the build just fine. When running through netlify it does not though.

The netlify.toml file is also just:

[build]
  command = "npm run build && npm run export"
  publish = "out"

and my package.json

{
  "name": "...",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "export": "npm run build && next export"
  },
  "dependencies": {
    "@contentful/rich-text-react-renderer": "^15.4.0",
    "@contentful/rich-text-types": "^15.3.6",
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-brands-svg-icons": "^5.15.4",
    "@fortawesome/free-regular-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-fontawesome": "^0.1.15",
    "@svgr/webpack": "^3.1.0",
    "antd": "^4.16.13",
    "bootstrap": "^5.0.0-beta3",
    "contentful": "^8.5.7",
    "date-fns": "^2.24.0",
    "dotenv": "^10.0.0",
    "lodash": "^4.17.21",
    "next": "11.1.2",
    "next-compose-plugins": "^2.2.1",
    "next-images": "^1.8.1",
    "next-optimized-images": "^1.4.2",
    "path": "^0.12.7",
    "prop-types": "^15.7.2",
    "raw-loader": "^4.0.2",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-markdown": "^7.0.1",
    "remark-gfm": "^2.0.0",
    "rsuite": "^4.10.3",
    "sass": "^1.41.0",
    "sass-loader": "^12.1.0",
    "survey-react": "^1.8.66",
    "surveyjs-widgets": "^1.8.66"
  },
  "devDependencies": {
    "babel-plugin-inline-react-svg": "^2.0.1",
    "eslint": "^7.32.0",
    "eslint-config-next": "11.1.2"
  }
}

Hi @mikhail-myalloy

Change

to

"scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "export": "next export"
  },

As mentioned in this part of your log, the @netlify/plugin-nextjs is not required when using export. Suggest removing this plugin from you build if you have it installed.

Hello @coelmay

I have changed to that export script and removed that plugin. Still getting the same build failed log :

5:53:28 PM: Build ready to start
5:53:30 PM: build-image version: 3bcb38c35508b42e9121d4badfe6d8c66fd7a3f0
5:53:30 PM: build-image tag: v4.3.2
5:53:30 PM: buildbot version: aee0303dea627c3e97b18430312d321caaaa48e3
5:53:30 PM: Fetching cached dependencies
5:53:30 PM: Failed to fetch cache, continuing with build
5:53:30 PM: Starting to prepare the repo for build
5:53:30 PM: No cached dependencies found. Cloning fresh repo
5:53:30 PM: git clone https://github.com/MyAlloy/alloy-marketing
5:53:54 PM: Preparing Git Reference refs/heads/quiz
5:53:55 PM: Parsing package.json dependencies
5:53:56 PM: Starting build script
5:53:56 PM: Installing dependencies
5:53:56 PM: Python version set to 2.7
5:53:56 PM: Downloading and installing node v16.13.0...
5:53:57 PM: Downloading https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz...
5:53:57 PM: Computing checksum with sha256sum
5:53:57 PM: Checksums matched!
5:54:00 PM: Now using node v16.13.0 (npm v8.1.0)
5:54:00 PM: Started restoring cached build plugins
5:54:00 PM: Finished restoring cached build plugins
5:54:00 PM: Attempting ruby version 2.7.2, read from environment
5:54:01 PM: Using ruby version 2.7.2
5:54:02 PM: Using PHP version 8.0
5:54:02 PM: Started restoring cached node modules
5:54:02 PM: Finished restoring cached node modules
5:54:02 PM: Installing NPM modules using NPM version 8.1.0
5:54:16 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
5:54:16 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
5:54:17 PM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
5:54:20 PM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
5:54:20 PM: npm WARN deprecated uuid@2.0.3: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
5:54:24 PM: npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
5:54:30 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
5:54:31 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
5:54:35 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
5:54:35 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
5:55:04 PM: added 1823 packages, and audited 1824 packages in 1m
5:55:04 PM: 187 packages are looking for funding
5:55:04 PM:   run `npm fund` for details
5:55:04 PM: 62 vulnerabilities (13 moderate, 29 high, 20 critical)
5:55:04 PM: To address issues that do not require attention, run:
5:55:04 PM:   npm audit fix
5:55:04 PM: To address all issues (including breaking changes), run:
5:55:04 PM:   npm audit fix --force
5:55:04 PM: Run `npm audit` for details.
5:55:04 PM: NPM modules installed
5:55:05 PM: Started restoring cached go cache
5:55:05 PM: Finished restoring cached go cache
5:55:05 PM: go version go1.16.5 linux/amd64
5:55:05 PM: go version go1.16.5 linux/amd64
5:55:05 PM: Installing missing commands
5:55:05 PM: Verify run directory
5:55:06 PM: ​
5:55:06 PM: ────────────────────────────────────────────────────────────────
5:55:06 PM:   Netlify Build                                                 
5:55:06 PM: ────────────────────────────────────────────────────────────────
5:55:06 PM: ​
5:55:06 PM: ❯ Version
5:55:06 PM:   @netlify/build 18.18.0
5:55:06 PM: ​
5:55:06 PM: ❯ Flags
5:55:06 PM:   baseRelDir: true
5:55:06 PM:   buildId: 617886e7b2287e0007ab2c12
5:55:06 PM:   deployId: 617886e7b2287e0007ab2c14
5:55:06 PM: ​
5:55:06 PM: ❯ Current directory
5:55:06 PM:   /opt/build/repo
5:55:06 PM: ​
5:55:06 PM: ❯ Config file
5:55:06 PM:   /opt/build/repo/netlify.toml
5:55:06 PM: ​
5:55:06 PM: ❯ Context
5:55:06 PM:   production
5:55:06 PM: ​
5:55:06 PM: ────────────────────────────────────────────────────────────────
5:55:06 PM:   1. build.command from netlify.toml                            
5:55:06 PM: ────────────────────────────────────────────────────────────────
5:55:06 PM: ​
5:55:06 PM: $ npm run build && npm run export
5:55:07 PM: > alloy-marketing@0.1.0 build
5:55:07 PM: > next build
5:55:07 PM: info  - Loaded env from /opt/build/repo/.env
5:55:08 PM: info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
5:55:08 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
5:55:08 PM: info  - Checking validity of types...
5:55:12 PM: ./pages/about-us.js
5:55:12 PM: 48:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 63:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 81:21  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 81:21  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: 109:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./pages/author/[slug].js
5:55:12 PM: 57:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./pages/blog/[slug].js
5:55:12 PM: 47:43  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 63:11  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 110:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 126:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./pages/blog.js
5:55:12 PM: 50:27  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 50:27  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: ./pages/expert/[slug].js
5:55:12 PM: 57:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./pages/how-it-works.js
5:55:12 PM: 59:19  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 59:19  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: ./pages/our-promise.js
5:55:12 PM: 32:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 69:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 80:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./pages/symptoms/[slug].js
5:55:12 PM: 60:17  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 60:17  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: 95:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 95:15  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: ./pages/symptoms.js
5:55:12 PM: 49:27  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./components/AboutList.js
5:55:12 PM: 22:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 22:15  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: 29:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 29:15  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: 36:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 36:15  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: ./components/BlogList.js
5:55:12 PM: 24:25  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 24:25  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: ./components/Footer.js
5:55:12 PM: 14:142  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./components/HowItWorks.js
5:55:12 PM: 31:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 31:15  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: 39:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 39:15  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: 47:15  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 47:15  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: ./components/NavBar.js
5:55:12 PM: 33:19  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./components/NewsList.js
5:55:12 PM: 14:19  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./components/ProductList.js
5:55:12 PM: 39:23  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: ./components/SymptomList.js
5:55:12 PM: 21:25  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 21:25  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: ./components/Upgrade.js
5:55:12 PM: 33:13  Warning: Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.  @next/next/no-img-element
5:55:12 PM: 33:13  Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.  jsx-a11y/alt-text
5:55:12 PM: info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
5:55:12 PM: info  - Creating an optimized production build...
5:55:21 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:55:21 PM: Recommendation: math.div(1, $rfs-rem-value)
5:55:21 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:55:21 PM:    β•·
5:55:21 PM: 49 β”‚   $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
5:55:21 PM:    β”‚                                                                         ^^^^^^^^^^^^^^^^^^
5:55:21 PM:    β•΅
5:55:21 PM:     styles/scss/bootstrap/vendor/_rfs.scss 49:73  @import
5:55:21 PM:     styles/scss/bootstrap/_mixins.scss 6:9        @import
5:55:21 PM:     styles/scss/alloy.scss 3:9                    root stylesheet
5:55:21 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:55:21 PM: Recommendation: math.div($rfs-base-font-size, $rfs-base-font-size * 0 + 1 / $rfs-rem-value)
5:55:21 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:55:21 PM:    β•·
5:55:21 PM: 49 β”‚   $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
5:55:21 PM:    β”‚                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5:55:21 PM:    β•΅
5:55:21 PM:     styles/scss/bootstrap/vendor/_rfs.scss 49:24  @import
5:55:21 PM:     styles/scss/bootstrap/_mixins.scss 6:9        @import
5:55:21 PM:     styles/scss/alloy.scss 3:9                    root stylesheet
5:55:21 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:55:21 PM: Recommendation: math.div($rfs-breakpoint, $rfs-breakpoint * 0 + 1)
5:55:21 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:55:21 PM:    β•·
5:55:21 PM: 57 β”‚   $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1);
5:55:21 PM:    β”‚                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5:55:21 PM:    β•΅
5:55:21 PM:     styles/scss/bootstrap/vendor/_rfs.scss 57:20  @import
5:55:21 PM:     styles/scss/bootstrap/_mixins.scss 6:9        @import
5:55:21 PM:     styles/scss/alloy.scss 3:9                    root stylesheet
5:55:22 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:55:22 PM: Recommendation: math.div($spacer, 2)
5:55:22 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:55:22 PM:     β•·
5:55:22 PM: 322 β”‚ $headings-margin-bottom:      $spacer / 2;
5:55:22 PM:     β”‚                               ^^^^^^^^^^^
5:55:22 PM:     β•΅
5:55:22 PM:     styles/scss/core/_variables.scss 322:31  @import
5:55:22 PM:     styles/scss/alloy.scss 6:9               root stylesheet
5:55:22 PM: DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.
5:55:22 PM: Recommendation: math.div($input-padding-y, 2)
5:55:22 PM: More info and automated migrator: https://sass-lang.com/d/slash-div
5:55:22 PM:     β•·
5:55:22 PM: 494 β”‚ $input-height-inner-quarter:            calc(#{$input-line-height * .25em} + #{$input-padding-y / 2}) !default;
5:55:22 PM:     β”‚                                                                                ^^^^^^^^^^^^^^^^^^^^
5:55:22 PM:     β•΅
5:55:22 PM:     styles/scss/bootstrap/_variables.scss 494:80  @import
5:55:22 PM:     styles/scss/bootstrap/bootstrap.scss 9:9      @import
5:55:22 PM:     styles/scss/alloy.scss 8:9                    root stylesheet
5:55:24 PM: WARNING: 66 repetitive deprecation warnings omitted.
5:55:51 PM: Failed to compile.
5:55:51 PM: 
5:55:51 PM: HookWebpackError: Maximum call stack size exceeded
5:55:51 PM: > Build error occurred
5:55:51 PM: Error: > Build failed because of webpack errors
5:55:51 PM:     at /opt/build/repo/node_modules/next/dist/build/index.js:397:19
5:55:51 PM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:60:20)
5:55:51 PM:     at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:77:25)
5:55:55 PM: ​
5:55:55 PM: ────────────────────────────────────────────────────────────────
5:55:55 PM:   "build.command" failed                                        
5:55:55 PM: ────────────────────────────────────────────────────────────────
5:55:55 PM: ​
5:55:55 PM:   Error message
5:55:55 PM:   Command failed with exit code 1: npm run build && npm run export
5:55:55 PM: ​
5:55:55 PM:   Error location
5:55:55 PM:   In build.command from netlify.toml:
5:55:55 PM:   npm run build && npm run export
5:55:55 PM: ​
5:55:55 PM:   Resolved config
5:55:55 PM:   build:
5:55:55 PM:     command: npm run build && npm run export
5:55:55 PM:     commandOrigin: config
5:55:55 PM:     publish: /opt/build/repo/out
5:55:55 PM:     publishOrigin: config
5:55:55 PM: Caching artifacts
5:55:55 PM: Started saving node modules
5:55:55 PM: Finished saving node modules
5:55:55 PM: Started saving build plugins
5:55:55 PM: Finished saving build plugins
5:55:55 PM: Started saving pip cache
5:55:55 PM: Finished saving pip cache
5:55:55 PM: Started saving emacs cask dependencies
5:55:55 PM: Finished saving emacs cask dependencies
5:55:55 PM: Started saving maven dependencies
5:55:55 PM: Finished saving maven dependencies
5:55:55 PM: Started saving boot dependencies
5:55:55 PM: Finished saving boot dependencies
5:55:55 PM: Started saving rust rustup cache
5:55:55 PM: Finished saving rust rustup cache
5:55:55 PM: Started saving go dependencies
5:55:55 PM: Finished saving go dependencies
5:55:59 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:55:59 PM: Creating deploy upload records
5:56:00 PM: Failing build: Failed to build site
5:56:00 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
5:56:00 PM: Finished processing build request in 2m30.261089471s

I tried creating on two other static generator websites (Vercel & Render) and it worked just fine there, but I am looking to stay on Netlify.

I know React by default will treat warnings as errors in CI environments. Next.js may well do the same. If so, you could choose to ignore them by changing the build command to CI='' npm run build && npm run export.

If not, then…

My understanding of next/image is that you should use <Image> instead of the standard HTML <img> tag.

As for the sass warnings I can only suggest following the information in the log (I don’t use sass myself so have no personal insights I can offer.)

Actually, it looks like the upload only worked once and is still continuing with an error when uploading again even though there are no more errors.

Can you share the error message? Are you able to share your git repository?

The error message is the same as before, attaching the log:

11:26:19 PM: Build ready to start
11:26:21 PM: build-image version: 3bcb38c35508b42e9121d4badfe6d8c66fd7a3f0
11:26:21 PM: build-image tag: v4.3.2
11:26:21 PM: buildbot version: aee0303dea627c3e97b18430312d321caaaa48e3
11:26:21 PM: Building without cache
11:26:21 PM: Starting to prepare the repo for build
11:26:21 PM: No cached dependencies found. Cloning fresh repo
11:26:21 PM: git clone https://github.com/MyAlloy/alloy-marketing
11:26:24 PM: Preparing Git Reference refs/heads/quiz
11:26:24 PM: Parsing package.json dependencies
11:26:25 PM: Starting build script
11:26:25 PM: Installing dependencies
11:26:25 PM: Python version set to 2.7
11:26:26 PM: Downloading and installing node v16.13.0...
11:26:26 PM: Downloading https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.xz...
11:26:26 PM: Computing checksum with sha256sum
11:26:27 PM: Checksums matched!
11:26:30 PM: Now using node v16.13.0 (npm v8.1.0)
11:26:30 PM: Started restoring cached build plugins
11:26:30 PM: Finished restoring cached build plugins
11:26:30 PM: Attempting ruby version 2.7.2, read from environment
11:26:32 PM: Using ruby version 2.7.2
11:26:32 PM: Using PHP version 8.0
11:26:32 PM: Started restoring cached node modules
11:26:32 PM: Finished restoring cached node modules
11:26:33 PM: Installing NPM modules using NPM version 8.1.0
11:26:46 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
11:26:46 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
11:26:47 PM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
11:26:48 PM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
11:26:50 PM: npm WARN deprecated uuid@2.0.3: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
11:26:52 PM: npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
11:26:56 PM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
11:26:57 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
11:26:58 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
11:27:22 PM: added 1478 packages, and audited 1479 packages in 48s
11:27:22 PM: 188 packages are looking for funding
11:27:22 PM:   run `npm fund` for details
11:27:22 PM: 59 vulnerabilities (9 moderate, 30 high, 20 critical)
11:27:22 PM: To address issues that do not require attention, run:
11:27:22 PM:   npm audit fix
11:27:22 PM: To address all issues (including breaking changes), run:
11:27:22 PM:   npm audit fix --force
11:27:22 PM: Run `npm audit` for details.
11:27:22 PM: NPM modules installed
11:27:22 PM: Started restoring cached go cache
11:27:22 PM: Finished restoring cached go cache
11:27:22 PM: go version go1.16.5 linux/amd64
11:27:22 PM: go version go1.16.5 linux/amd64
11:27:22 PM: Installing missing commands
11:27:22 PM: Verify run directory
11:27:23 PM: ​
11:27:23 PM: ────────────────────────────────────────────────────────────────
11:27:23 PM:   Netlify Build                                                 
11:27:23 PM: ────────────────────────────────────────────────────────────────
11:27:23 PM: ​
11:27:23 PM: ❯ Version
11:27:23 PM:   @netlify/build 18.18.0
11:27:23 PM: ​
11:27:23 PM: ❯ Flags
11:27:23 PM:   baseRelDir: true
11:27:23 PM:   buildId: 6178d4eb074faf5c2e1eba19
11:27:23 PM:   deployId: 6178d4eb074faf5c2e1eba1b
11:27:23 PM: ​
11:27:23 PM: ❯ Current directory
11:27:23 PM:   /opt/build/repo
11:27:23 PM: ​
11:27:23 PM: ❯ Config file
11:27:23 PM:   /opt/build/repo/netlify.toml
11:27:23 PM: ​
11:27:23 PM: ❯ Context
11:27:23 PM:   production
11:27:24 PM: ​
11:27:24 PM: ❯ Installing plugins
11:27:24 PM:    - @netlify/plugin-nextjs@3.9.2
11:27:34 PM: ​
11:27:34 PM: ❯ Loading plugins
11:27:34 PM:    - @netlify/plugin-nextjs@3.9.2 from Netlify app
11:27:35 PM: ​
11:27:35 PM: ────────────────────────────────────────────────────────────────
11:27:35 PM:   1. @netlify/plugin-nextjs (onPreBuild event)                  
11:27:35 PM: ────────────────────────────────────────────────────────────────
11:27:35 PM: ​
11:27:35 PM: Using Next.js 11.1.0
11:27:35 PM: Warning: support for Next.js >=11.1.0 is experimental
11:27:35 PM: NOTE: Static HTML export Next.js projects (projects that use `next export`) do not require most of this plugin. For these sites, this plugin *only* caches builds.
11:27:35 PM: ​
11:27:35 PM: (@netlify/plugin-nextjs onPreBuild completed in 19ms)
11:27:35 PM: ​
11:27:35 PM: ────────────────────────────────────────────────────────────────
11:27:35 PM:   2. build.command from netlify.toml                            
11:27:35 PM: ────────────────────────────────────────────────────────────────
11:27:35 PM: ​
11:27:35 PM: $ npm run build && npm run export
11:27:35 PM: > alloy-marketing@0.1.0 build
11:27:35 PM: > next build
11:27:36 PM: info  - Loaded env from /opt/build/repo/.env
11:27:36 PM: info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
11:27:37 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
11:27:37 PM: info  - Checking validity of types...
11:27:40 PM: info  - Creating an optimized production build...
11:28:18 PM: Failed to compile.
11:28:18 PM: 
11:28:18 PM: HookWebpackError: Maximum call stack size exceeded
11:28:18 PM: > Build error occurred
11:28:18 PM: Error: > Build failed because of webpack errors
11:28:18 PM:     at /opt/build/repo/node_modules/next/dist/build/index.js:390:19
11:28:18 PM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/telemetry/trace/trace.js:60:20)
11:28:21 PM: ​
11:28:21 PM: ────────────────────────────────────────────────────────────────
11:28:21 PM:   "build.command" failed                                        
11:28:21 PM: ────────────────────────────────────────────────────────────────
11:28:21 PM: ​
11:28:21 PM:   Error message
11:28:21 PM:   Command failed with exit code 1: npm run build && npm run export
11:28:21 PM: ​
11:28:21 PM:   Error location
11:28:21 PM:   In build.command from netlify.toml:
11:28:21 PM:   npm run build && npm run export
11:28:21 PM: ​
11:28:21 PM:   Resolved config
11:28:21 PM:   build:
11:28:21 PM:     command: npm run build && npm run export
11:28:21 PM:     commandOrigin: config
11:28:21 PM:     publish: /opt/build/repo/out
11:28:21 PM:     publishOrigin: config
11:28:21 PM:   plugins:
11:28:21 PM:     - inputs: {}
11:28:21 PM:       origin: ui
11:28:21 PM:       package: '@netlify/plugin-nextjs'
11:28:21 PM: Caching artifacts
11:28:21 PM: Started saving node modules
11:28:21 PM: Finished saving node modules
11:28:21 PM: Started saving build plugins
11:28:21 PM: Finished saving build plugins
11:28:21 PM: Started saving pip cache
11:28:21 PM: Finished saving pip cache
11:28:21 PM: Started saving emacs cask dependencies
11:28:21 PM: Finished saving emacs cask dependencies
11:28:21 PM: Started saving maven dependencies
11:28:21 PM: Finished saving maven dependencies
11:28:21 PM: Started saving boot dependencies
11:28:21 PM: Finished saving boot dependencies
11:28:21 PM: Started saving rust rustup cache
11:28:21 PM: Finished saving rust rustup cache
11:28:21 PM: Started saving go dependencies
11:28:21 PM: Finished saving go dependencies
11:28:24 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:28:24 PM: Creating deploy upload records
11:28:24 PM: Failing build: Failed to build site
11:28:24 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
11:28:24 PM: Finished processing build request in 2m3.354472816s

I can’t share the repo, but I can share certain folders / files

I think that we need to fully look at the entire project in order to understand what is the reason. Sometimes there are just banal problems. You can just try to create the main page of the site and try to expand it. If possible, then add other pages of the site to the project.

Maximum call stack error could indicate something wrong with a recursive call or something similar. Are you able to share your repo?

I have found the problem finally, it was within a component in the code. Thank you to everyone who help :raised_hands:

1 Like

So glad you got this working, thanks for following up and letting us know :netliconfetti: