Hello Team,
Iβm facing issue while deploying nextjs application on netlify . Followed steps as mentioned on site
I tried by clearing cache , replaced node-fetch with isomorphic-fetch with no luck.
7:25:15 PM: Build ready to start
7:25:18 PM: build-image version: 53b83b6bede2920f236b25b6f5a95334320dc849
7:25:18 PM: build-image tag: v3.6.0
7:25:18 PM: buildbot version: 8ae026ef4905d9174e416775c6b64aa19950569b
7:25:18 PM: Fetching cached dependencies
7:25:18 PM: Failed to fetch cache, continuing with build
7:25:18 PM: Starting to prepare the repo for build
7:25:18 PM: No cached dependencies found. Cloning fresh repo
7:25:18 PM: git clone https://github.com/Adityacs001/app-hrms
7:25:19 PM: Preparing Git Reference refs/heads/master
7:25:21 PM: Different build command detected, going to use the one specified in the Netlify configuration file: βnpm run buildβ versus βnext buildβ in the Netlify UI
7:25:21 PM: Starting build script
7:25:21 PM: Installing dependencies
7:25:21 PM: Python version set to 2.7
7:25:22 PM: v12.18.0 is already installed.
7:25:23 PM: Now using node v12.18.0 (npm v6.14.4)
7:25:23 PM: Started restoring cached build plugins
7:25:23 PM: Finished restoring cached build plugins
7:25:23 PM: Attempting ruby version 2.7.1, read from environment
7:25:24 PM: Using ruby version 2.7.1
7:25:24 PM: Using PHP version 5.6
7:25:24 PM: Started restoring cached node modules
7:25:24 PM: Finished restoring cached node modules
7:25:24 PM: Started restoring cached yarn cache
7:25:24 PM: Finished restoring cached yarn cache
7:25:24 PM: Installing yarn at version 1.22.4
7:25:24 PM: Installing Yarn!
7:25:24 PM: > Downloading tarballβ¦
7:25:24 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz β /tmp/yarn.tar.gz.pLtWLdh1H5
7:25:24 PM: % Total % Received % Xferd Average Speed Time Time Time Current
7:25:24 PM: Dload Upload Total Spent Left Speed
7:25:24 PM: 0 0 0 0 0 0 0 0 --:β:-- --:β:-- --:β:-- 0
7:25:25 PM: 0 0 0 0 0 0 0 0 --:β:-- --:β:-- --:β:-- 0
7:25:25 PM: 100 80 100 80 0 0 282 0 --:β:-- --:β:-- --:β:-- 281
7:25:25 PM: 100 93 100 93 0 0 157 0 --:β:-- --:β:-- --:β:-- 157
7:25:25 PM: 100 643 100 643 0 0 744 0 --:β:-- --:β:-- --:β:-- 744
7:25:26 PM: 0 0 0 0 0 0 0 0 --:β:-- 0:00:01 --:β:-- 0
7:25:26 PM: 100 1215k 100 1215k 0 0 941k 0 0:00:01 0:00:01 --:β:-- 5378k
7:25:26 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc β /tmp/yarn.tar.gz.pLtWLdh1H5.asc
7:25:26 PM: 100 84 100 84 0 0 3048 0 --:β:-- --:β:-- --:β:-- 3048
7:25:26 PM: 100 97 100 97 0 0 1737 0 --:β:-- --:β:-- --:β:-- 1737
7:25:26 PM: 100 647 100 647 0 0 7370 0 --:β:-- --:β:-- --:β:-- 7370
7:25:26 PM: 100 1028 100 1028 0 0 7798 0 --:β:-- --:β:-- --:β:-- 7798
7:25:26 PM: > Verifying integrityβ¦
7:25:26 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
7:25:26 PM: gpg: Good signature from βYarn Packaging yarn@dan.cxβ
7:25:26 PM: gpg: WARNING: This key is not certified with a trusted signature!
7:25:26 PM: gpg: There is no indication that the signature belongs to the owner.
7:25:26 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
7:25:26 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
7:25:26 PM: > GPG signature looks good
7:25:26 PM: > Extracting to ~/.yarnβ¦
7:25:26 PM: > Adding to $PATHβ¦
7:25:26 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the yarn
command will now be available.
7:25:27 PM: Installing NPM modules using Yarn version 1.22.4
7:25:27 PM: yarn install v1.22.4
7:25:27 PM: [1/4] Resolving packagesβ¦
7:25:27 PM: [2/4] Fetching packagesβ¦
7:25:39 PM: info fsevents@2.1.3: The platform βlinuxβ is incompatible with this module.
7:25:39 PM: info βfsevents@2.1.3β is an optional dependency and failed compatibility check. Excluding it from installation.
7:25:39 PM: info fsevents@1.2.13: The platform βlinuxβ is incompatible with this module.
7:25:39 PM: info βfsevents@1.2.13β is an optional dependency and failed compatibility check. Excluding it from installation.
7:25:39 PM: [3/4] Linking dependenciesβ¦
7:25:39 PM: warning " > cogo-toast@4.2.3" has unmet peer dependency βprop-types@^15.6.2β.
7:25:39 PM: warning " > cogo-toast@4.2.3" has incorrect peer dependency βreact@^16.8.0β.
7:25:39 PM: warning " > cogo-toast@4.2.3" has incorrect peer dependency βreact-dom@^16.8.0β.
7:25:39 PM: warning β@netlify/plugin-nextjs > next-on-netlify > @sls-next/lambda-at-edge > @zeit/node-file-trace > acorn-export-ns-from@0.1.0β has incorrect peer dependency βacorn@^6.0.1β.
7:25:39 PM: warning β@netlify/plugin-nextjs > next-on-netlify > @sls-next/lambda-at-edge > @aws-sdk/client-s3 > @aws-sdk/middleware-retry > react-native-get-random-values@1.5.0β has unmet peer dependency βreact-native@>=0.56β.
7:25:45 PM: [4/4] Building fresh packagesβ¦
7:25:48 PM: Done in 21.25s.
7:25:48 PM: NPM modules installed using Yarn
7:25:48 PM: Started restoring cached go cache
7:25:48 PM: Finished restoring cached go cache
7:25:49 PM: go version go1.14.4 linux/amd64
7:25:49 PM: go version go1.14.4 linux/amd64
7:25:49 PM: Installing missing commands
7:25:49 PM: Verify run directory
7:25:50 PM: β
7:25:50 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:25:50 PM: Netlify Build
7:25:50 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:25:50 PM: β
7:25:50 PM: β― Version
7:25:50 PM: @netlify/build 8.0.0
7:25:50 PM: β
7:25:50 PM: β― Flags
7:25:50 PM: deployId: 5fe3615b485ce800078a0aa9
7:25:50 PM: mode: buildbot
7:25:50 PM: β
7:25:50 PM: β― Current directory
7:25:50 PM: /opt/build/repo
7:25:50 PM: β
7:25:50 PM: β― Config file
7:25:50 PM: /opt/build/repo/netlify.toml
7:25:50 PM: β
7:25:50 PM: β― Context
7:25:50 PM: production
7:25:50 PM: β
7:25:50 PM: β― Loading plugins
7:25:50 PM: - @netlify/plugin-nextjs@1.0.3 from netlify.toml and package.json
7:25:51 PM: β
7:25:51 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:25:51 PM: 1. onPreBuild command from @netlify/plugin-nextjs
7:25:51 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:25:51 PM: β
7:25:51 PM: ** Warning: support for Next.js >=10.0.0 is experimental **
7:25:51 PM: ** Adding next.config.js with target set to βserverlessβ **
7:25:51 PM: β
7:25:51 PM: (@netlify/plugin-nextjs onPreBuild completed in 10ms)
7:25:51 PM: β
7:25:51 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:25:51 PM: 2. build.command from netlify.toml
7:25:51 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:25:51 PM: β
7:25:51 PM: $ npm run build
7:25:51 PM: > app-hrms@1.0.0 build /opt/build/repo
7:25:51 PM: > next build
7:25:52 PM: Loaded env from /opt/build/repo/.env
7:25:52 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: no-cache | Next.js
7:25:52 PM: info - Creating an optimized production buildβ¦
7:26:15 PM: warn - Compiled with warnings
7:26:15 PM: ./node_modules/next/dist/next-server/server/load-components.js
7:26:15 PM: Critical dependency: the request of a dependency is an expression
7:26:15 PM: ./node_modules/next/dist/next-server/server/load-components.js
7:26:15 PM: Critical dependency: the request of a dependency is an expression
7:26:15 PM: ./node_modules/next/dist/next-server/server/require.js
7:26:15 PM: Critical dependency: the request of a dependency is an expression
7:26:15 PM: ./node_modules/next/dist/next-server/server/require.js
7:26:15 PM: Critical dependency: the request of a dependency is an expression
7:26:15 PM: ./node_modules/next/dist/next-server/server/require.js
7:26:15 PM: Critical dependency: the request of a dependency is an expression
7:26:15 PM: ./node_modules/node-fetch/lib/index.js
7:26:15 PM: Module not found: Canβt resolve βencodingβ in β/opt/build/repo/node_modules/node-fetch/libβ
7:26:15 PM: info - Collecting page dataβ¦
7:26:16 PM: info - Generating static pages (0/2)
7:26:17 PM: info - Generating static pages (2/2)
7:26:17 PM: info - Finalizing page optimizationβ¦
7:26:17 PM: Page Size First Load JS
7:26:17 PM: β β / 12.4 kB 75.1 kB
7:26:17 PM: β /_app 0 B 62.7 kB
7:26:17 PM: β β /404 3.01 kB 65.7 kB
7:26:17 PM: β Ξ» /api/login 0 B 62.7 kB
7:26:17 PM: β Ξ» /api/logout 0 B 62.7 kB
7:26:17 PM: β Ξ» /dashboard 4.81 kB 67.5 kB
7:26:17 PM: + First Load JS shared by all 62.7 kB
7:26:17 PM: β chunks/commons.9b549c.js 12.8 kB
7:26:17 PM: β chunks/framework.08d108.js 42.1 kB
7:26:17 PM: β chunks/main.71f255.js 6.55 kB
7:26:17 PM: β chunks/pages/_app.3d4ac7.js 526 B
7:26:17 PM: β chunks/webpack.95c2b2.js 751 B
7:26:17 PM: β css/a42914e8e93ff3ff3368.css 4.27 kB
7:26:17 PM: Ξ» (Lambda) server-side renders at runtime (uses getInitialProps or getServerSideProps)
7:26:17 PM: β (Static) automatically rendered as static HTML (uses no initial props)
7:26:17 PM: β (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
7:26:17 PM: (ISR) incremental static regeneration (uses revalidate in getStaticProps)
7:26:17 PM: β
7:26:17 PM: (build.command completed in 25.9s)
7:26:17 PM: β
7:26:17 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:26:17 PM: 3. onBuild command from @netlify/plugin-nextjs
7:26:17 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:26:17 PM: β
7:26:17 PM: ** Running Next on Netlify package **
7:26:17 PM: Next on Netlify
7:26:17 PM: Functions directory: netlify-automatic-functions
7:26:17 PM: Publish directory: /opt/build/repo
7:26:17 PM: Make sure these are set in your netlify.toml file.
7:26:17 PM: Copying public/ folder to /opt/build/repo
7:26:17 PM: Copying static NextJS assets to /opt/build/repo
7:26:17 PM: Setting up API endpoints as Netlify Functions in netlify-automatic-functions
7:26:17 PM: Setting up pages with getInitialProps as Netlify Functions in netlify-automatic-functions
7:26:17 PM: Setting up pages with getServerSideProps as Netlify Functions in netlify-automatic-functions
7:26:17 PM: Copying pre-rendered pages with getStaticProps and JSON data to /opt/build/repo
7:26:17 PM: Setting up pages with getStaticProps and fallback: true as Netlify Functions in netlify-automatic-functions
7:26:17 PM: Setting up pages with getStaticProps and revalidation interval as Netlify Functions in netlify-automatic-functions
7:26:17 PM: Copying pre-rendered pages without props to /opt/build/repo
7:26:17 PM: Setting up redirects
7:26:17 PM: β
7:26:17 PM: (@netlify/plugin-nextjs onBuild completed in 147ms)
7:26:17 PM: β
7:26:17 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:26:17 PM: 4. Functions bundling
7:26:17 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:26:17 PM: β
7:26:17 PM: Packaging Functions from netlify-automatic-functions directory:
7:26:17 PM: - next_api_login/next_api_login.js
7:26:17 PM: - next_api_logout/next_api_logout.js
7:26:17 PM: - next_dashboard/next_dashboard.js
7:26:22 PM: β
7:26:22 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:26:22 PM: Dependencies installation error
7:26:22 PM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7:26:22 PM: β
7:26:22 PM: Error message
7:26:22 PM: A Netlify Function failed to require one of its dependencies.
7:26:22 PM: If the dependency is a Node module, please make sure it is present in the siteβs top-level βpackage.jsonβ. If it is a local file instead, please make sure the file exists and its filename is correctly spelled.
7:26:22 PM: β
7:26:22 PM: In file β/opt/build/repo/netlify-automatic-functions/next_dashboard/next_dashboard.jsβ
7:26:22 PM: Cannot find module βcrittersβ
7:26:22 PM: Require stack:
7:26:22 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/resolve.js
7:26:22 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/dependencies.js
7:26:22 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/node_modules/@netlify/zip-it-and-ship-it/src/main.js
7:26:22 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/index.js
7:26:22 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/commands/get.js
7:26:22 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/core/main.js
7:26:22 PM: - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/core/bin.js
7:26:22 PM: β
7:26:22 PM: Resolved config
7:26:22 PM: build:
7:26:22 PM: command: npm run build
7:26:22 PM: commandOrigin: config
7:26:22 PM: environment:
7:26:22 PM: - APPLICATION_COOKIE_NAME
7:26:22 PM: - APPLICATION_SECRET
7:26:22 PM: - NEXT_APP_APPLICATION_SECRET
7:26:22 PM: plugins:
7:26:22 PM: - inputs: {}
7:26:22 PM: origin: config
7:26:22 PM: package: β@netlify/plugin-nextjsβ
7:26:22 PM: Caching artifacts
7:26:22 PM: Started saving node modules
7:26:22 PM: Finished saving node modules
7:26:22 PM: Started saving build plugins
7:26:22 PM: Finished saving build plugins
7:26:22 PM: Started saving yarn cache
7:26:22 PM: Finished saving yarn cache
7:26:22 PM: Started saving pip cache
7:26:22 PM: Finished saving pip cache
7:26:22 PM: Started saving emacs cask dependencies
7:26:22 PM: Finished saving emacs cask dependencies
7:26:22 PM: Started saving maven dependencies
7:26:22 PM: Finished saving maven dependencies
7:26:22 PM: Started saving boot dependencies
7:26:22 PM: Finished saving boot dependencies
7:26:22 PM: Started saving rust rustup cache
7:26:22 PM: Finished saving rust rustup cache
7:26:22 PM: Started saving rust cargo bin cache
7:26:22 PM: Finished saving rust cargo bin cache
7:26:22 PM: Started saving go dependencies
7:26:22 PM: Finished saving go dependencies
7:26:25 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:26:25 PM: Failing build: Failed to build site
7:26:25 PM: Failed during stage βbuilding siteβ: Build script returned non-zero exit code: 2
7:26:25 PM: Finished processing build request in 1m7.331918145s