'How to deploy NextJs Minting App to Netlify without build errors?
I try it now for 3 days to fix what's wrong but nothing works for me can someone help?
Netlify Build Log:
6:31:18 PM: Build ready to start
6:31:20 PM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
6:31:20 PM: build-image tag: v4.8.0
6:31:20 PM: buildbot version: 29e546ddee264a16af472b38ccba15b350150213
6:31:20 PM: Building without cache
6:31:20 PM: Starting to prepare the repo for build
6:31:21 PM: No cached dependencies found. Cloning fresh repo
6:31:21 PM: git clone https://github.com/Smokimcpot/MintingDiniTante
6:31:22 PM: Preparing Git Reference refs/heads/main
6:31:22 PM: Parsing package.json dependencies
6:31:23 PM: Starting build script
6:31:23 PM: Installing dependencies
6:31:23 PM: Python version set to 2.7
6:31:24 PM: Downloading and installing node v16.13.2...
6:31:24 PM: Downloading https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.xz...
6:31:25 PM: Computing checksum with sha256sum
6:31:25 PM: Checksums matched!
6:31:28 PM: Now using node v16.13.2 (npm v8.1.2)
6:31:28 PM: Started restoring cached build plugins
6:31:28 PM: Finished restoring cached build plugins
6:31:29 PM: Attempting ruby version 2.7.2, read from environment
6:31:30 PM: Using ruby version 2.7.2
6:31:30 PM: Using PHP version 8.0
6:31:31 PM: No npm workspaces detected
6:31:31 PM: Started restoring cached node modules
6:31:31 PM: Finished restoring cached node modules
6:31:31 PM: Found npm version (8.1.2) that doesn't match expected (8.4.0)
Installing npm at version 8.4.0
6:31:34 PM: removed 8 packages, changed 47 packages, and audited 218 packages in 3s
6:31:34 PM: 11 packages are looking for funding
6:31:34 PM: run `npm fund` for details
6:31:34 PM: 1 high severity vulnerability
6:31:34 PM: To address all issues, run:
6:31:34 PM: npm audit fix
6:31:34 PM: Run `npm audit` for details.
6:31:34 PM: NPM installed successfully
6:31:35 PM: Installing NPM modules using NPM version 8.4.0
6:31:37 PM: npm WARN deprecated [email protected]: ganache-core is now ganache; visit https://trfl.io/g7 for details
6:31:38 PM: npm WARN deprecated [email protected]: ganache-core is now ganache; visit https://trfl.io/g7 for details
6:31:49 PM: npm WARN deprecated [email protected]: this library is no longer supported
6:31:51 PM: npm WARN deprecated [email protected]: 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.
6:31:51 PM: npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
6:31:56 PM: npm WARN deprecated [email protected]: testrpc has been renamed to ganache-cli, please use this package from now on.
6:31:57 PM: npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
6:31:57 PM: npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
6:31:57 PM: npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
6:31:59 PM: npm WARN deprecated [email protected]: Deprecated in favor of '@metamask/eth-sig-util'
6:32:01 PM: npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
6:32:01 PM: npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
6:32:02 PM: npm WARN deprecated @walletconnect/[email protected]: Deprecated in favor of dynamic registry available from: https://github.com/walletconnect/walletconnect-registry
6:32:02 PM: npm WARN deprecated @types/[email protected]: This is a stub types definition. web3 provides its own type definitions, so you do not need this installed.
6:32:05 PM: npm WARN deprecated [email protected]: 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.
6:32:10 PM: npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
6:32:11 PM: npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
6:32:27 PM: npm WARN deprecated [email protected]: This module has been superseded by the multiformats module
6:32:28 PM: npm WARN deprecated @ensdomains/[email protected]: Please use @ensdomains/ens-contracts
6:32:29 PM: npm WARN deprecated @ensdomains/[email protected]: Please use @ensdomains/ens-contracts
6:32:41 PM: added 2086 packages, and audited 2090 packages in 1m
6:32:41 PM: 221 packages are looking for funding
6:32:41 PM: run `npm fund` for details
6:32:41 PM: 54 vulnerabilities (11 moderate, 42 high, 1 critical)
6:32:41 PM: To address issues that do not require attention, run:
6:32:41 PM: npm audit fix
6:32:41 PM: Some issues need review, and may require choosing
6:32:41 PM: a different dependency.
6:32:41 PM: Run `npm audit` for details.
6:32:41 PM: NPM modules installed
6:32:41 PM: Started restoring cached go cache
6:32:41 PM: Finished restoring cached go cache
6:32:41 PM: go version go1.16.5 linux/amd64
6:32:41 PM: go version go1.16.5 linux/amd64
6:32:41 PM: Installing missing commands
6:32:41 PM: Verify run directory
6:32:43 PM:
6:32:43 PM: ────────────────────────────────────────────────────────────────
6:32:43 PM: Netlify Build
6:32:43 PM: ────────────────────────────────────────────────────────────────
6:32:43 PM:
6:32:43 PM: ❯ Version
6:32:43 PM: @netlify/build 27.1.1
6:32:43 PM:
6:32:43 PM: ❯ Flags
6:32:43 PM: baseRelDir: true
6:32:43 PM: buildId: 627d36568a0f640d7188d81e
6:32:43 PM: deployId: 627d36568a0f640d7188d820
6:32:43 PM:
6:32:43 PM: ❯ Current directory
6:32:43 PM: /opt/build/repo
6:32:43 PM:
6:32:43 PM: ❯ Config file
6:32:43 PM: No config file was defined: using default values.
6:32:43 PM:
6:32:43 PM: ❯ Context
6:32:43 PM: production
6:32:43 PM:
6:32:43 PM: ❯ Installing plugins
6:32:43 PM: - @netlify/[email protected]
6:32:57 PM:
6:32:57 PM: ❯ Loading plugins
6:32:57 PM: - @netlify/[email protected] from Netlify app
6:32:58 PM:
6:32:58 PM: ────────────────────────────────────────────────────────────────
6:32:58 PM: 1. @netlify/plugin-nextjs (onPreBuild event)
6:32:58 PM: ────────────────────────────────────────────────────────────────
6:32:58 PM:
6:32:58 PM: No Next.js cache to restore.
6:32:58 PM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
6:32:58 PM:
6:32:58 PM: (@netlify/plugin-nextjs onPreBuild completed in 17ms)
6:32:58 PM:
6:32:58 PM: ────────────────────────────────────────────────────────────────
6:32:58 PM: 2. Build command from Netlify app
6:32:58 PM: ────────────────────────────────────────────────────────────────
6:32:58 PM:
6:32:58 PM: $ npm run build
6:32:59 PM: > [email protected] build
6:32:59 PM: > next build
6:33:00 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
6:33:00 PM: info - Checking validity of types...
6:33:02 PM: ./pages/index.js
6:33:02 PM: 108: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
6:33:02 PM: 108:13 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
6:33:02 PM: ./pages/mint.js
6:33:02 PM: 127:9 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
6:33:02 PM: 127:9 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
6:33:02 PM: 166: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
6:33:02 PM: 166:17 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
6:33:02 PM: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
6:33:02 PM: info - Creating an optimized production build...
6:34:03 PM: info - Compiled successfully
6:34:03 PM: info - Collecting page data...
6:34:05 PM: > Build error occurred
6:34:05 PM: TypeError: Cannot read properties of undefined (reading 'includes')
6:34:05 PM: at Object.makeRestPayloadSender (/opt/build/repo/node_modules/@alch/alchemy-web3/dist/cjs/web3-adapter/sendRestPayload.js:16:14)
6:34:05 PM: at Object.makeAlchemyContext (/opt/build/repo/node_modules/@alch/alchemy-web3/dist/cjs/web3-adapter/alchemyContext.js:18:40)
6:34:05 PM: at createAlchemyWeb3 (/opt/build/repo/node_modules/@alch/alchemy-web3/dist/cjs/index.js:21:31)
6:34:05 PM: at Object.3677 (/opt/build/repo/.next/server/pages/mint.js:488:14)
6:34:05 PM: at __webpack_require__ (/opt/build/repo/.next/server/webpack-runtime.js:25:42)
6:34:05 PM: at /opt/build/repo/.next/server/pages/mint.js:171:73
6:34:05 PM: at Function.__webpack_require__.a (/opt/build/repo/.next/server/webpack-runtime.js:103:13)
6:34:05 PM: at Object.8966 (/opt/build/repo/.next/server/pages/mint.js:159:21)
6:34:05 PM: at __webpack_require__ (/opt/build/repo/.next/server/webpack-runtime.js:25:42)
6:34:05 PM: at __webpack_exec__ (/opt/build/repo/.next/server/pages/mint.js:794:39)
6:34:05 PM: at /opt/build/repo/.next/server/pages/mint.js:795:28
6:34:05 PM: at Object.<anonymous> (/opt/build/repo/.next/server/pages/mint.js:798:3)
6:34:05 PM: at Module._compile (node:internal/modules/cjs/loader:1101:14)
6:34:05 PM: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
6:34:05 PM: at Module.load (node:internal/modules/cjs/loader:981:32)
6:34:05 PM: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
6:34:05 PM: type: 'TypeError'
6:34:05 PM: }
6:34:05 PM:
6:34:05 PM: ────────────────────────────────────────────────────────────────
6:34:05 PM: "build.command" failed
6:34:05 PM: ────────────────────────────────────────────────────────────────
6:34:05 PM:
6:34:05 PM: Error message
6:34:05 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
6:34:05 PM:
6:34:05 PM: Error location
6:34:05 PM: In Build command from Netlify app:
6:34:05 PM: npm run build
6:34:05 PM:
6:34:05 PM: Resolved config
6:34:05 PM: build:
6:34:05 PM: command: npm run build
6:34:05 PM: commandOrigin: ui
6:34:05 PM: environment:
6:34:05 PM: - NODE_VERSION
6:34:05 PM: - NPM_VERSION
6:34:05 PM: - NEXT_PRIVATE_TARGET
6:34:05 PM: publish: /opt/build/repo/.next
6:34:05 PM: publishOrigin: ui
6:34:05 PM: plugins:
6:34:05 PM: - inputs: {}
6:34:05 PM: origin: ui
6:34:05 PM: package: '@netlify/plugin-nextjs'
6:34:05 PM: Caching artifacts
6:34:05 PM: Started saving node modules
6:34:05 PM: Finished saving node modules
6:34:05 PM: Started saving build plugins
6:34:05 PM: Finished saving build plugins
6:34:05 PM: Started saving pip cache
6:34:05 PM: Finished saving pip cache
6:34:05 PM: Started saving emacs cask dependencies
6:34:05 PM: Finished saving emacs cask dependencies
6:34:05 PM: Started saving maven dependencies
6:34:05 PM: Finished saving maven dependencies
6:34:05 PM: Started saving boot dependencies
6:34:07 PM: Creating deploy upload records
6:34:05 PM: Finished saving boot dependencies
6:34:05 PM: Started saving rust rustup cache
6:34:05 PM: Finished saving rust rustup cache
6:34:05 PM: Started saving go dependencies
6:34:05 PM: Finished saving go dependencies
6:34:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:34:07 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
6:34:07 PM: Failing build: Failed to build site
6:34:07 PM: Finished processing build request in 2m47.154914109s
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|