Home
Support Forums

Error on build NextJS + Next-Auth

Hi, recently I’m trying to build a NextJS application, but an error return’s from the Dependencies installation error:

12:00:19 PM: Build ready to start
12:00:21 PM: build-image version: c6001ed68662a13e5deb24abec2b46058c58248a
12:00:21 PM: build-image tag: v3.9.0
12:00:21 PM: buildbot version: 0d69a20db0b5dda37e383402cf2a26e5b4f328ad
12:00:21 PM: Fetching cached dependencies
12:00:21 PM: Failed to fetch cache, continuing with build
12:00:21 PM: Starting to prepare the repo for build
12:00:22 PM: No cached dependencies found. Cloning fresh repo
12:00:22 PM: git clone https://github.com/justapagamentos/conta-justa-web-react
12:00:23 PM: Preparing Git Reference refs/heads/feat/add-slide-home
12:00:24 PM: Parsing package.json dependencies
12:00:25 PM: Starting build script
12:00:25 PM: Installing dependencies
12:00:25 PM: Python version set to 2.7
12:00:27 PM: v12.18.0 is already installed.
12:00:27 PM: Now using node v12.18.0 (npm v6.14.4)
12:00:27 PM: Started restoring cached build plugins
12:00:27 PM: Finished restoring cached build plugins
12:00:28 PM: Attempting ruby version 2.7.2, read from environment
12:00:29 PM: Using ruby version 2.7.2
12:00:30 PM: Using PHP version 5.6
12:00:30 PM: Started restoring cached yarn cache
12:00:30 PM: Finished restoring cached yarn cache
12:00:30 PM: Installing yarn at version 1.22.10
12:00:30 PM: Installing Yarn!
12:00:30 PM: > Downloading tarball...
12:00:30 PM: [1/2]: https://yarnpkg.com/downloads/1.22.10/yarn-v1.22.10.tar.gz --> /tmp/yarn.tar.gz.rdm0R9sXPi
12:00:30 PM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
12:00:30 PM:                                  Dload  Upload   Total   Spent    Left  Speed
12:00:30 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
12:00:30 PM: 100    81  100    81    0     0    380      0 --:--:-- --:--:-- --:--:--   382
12:00:30 PM: 100    95  100    95    0     0    172      0 --:--:-- --:--:-- --:--:--   172
12:00:30 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
12:00:30 PM: 100   626  100   626    0     0    699      0 --:--:-- --:--:-- --:--:--  2675
12:00:31 PM: 100 1215k  100 1215k    0     0   956k      0  0:00:01  0:00:01 --:--:--  956k
12:00:31 PM: [2/2]: https://yarnpkg.com/downloads/1.22.10/yarn-v1.22.10.tar.gz.asc --> /tmp/yarn.tar.gz.rdm0R9sXPi.asc
12:00:31 PM: 100    85  100    85    0     0   1547      0 --:--:-- --:--:-- --:--:--  1547
12:00:31 PM: 100    99  100    99    0     0   1177      0 --:--:-- --:--:-- --:--:--  1177
12:00:31 PM: 100   630  100   630    0     0   3347      0 --:--:-- --:--:-- --:--:--  3347
12:00:31 PM: 100   832  100   832    0     0   3413      0 --:--:-- --:--:-- --:--:--  3413
12:00:31 PM: > Verifying integrity...
12:00:31 PM: gpg: Signature made Fri 02 Oct 2020 11:17:27 AM UTC using RSA key ID 69475BAA
12:00:31 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
12:00:31 PM: gpg: WARNING: This key is not certified with a trusted signature!
12:00:31 PM: gpg:          There is no indication that the signature belongs to the owner.
12:00:31 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
12:00:31 PM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
12:00:31 PM: > GPG signature looks good
12:00:31 PM: > Extracting to ~/.yarn...
12:00:31 PM: > Adding to $PATH...
12:00:32 PM: > Successfully installed Yarn 1.22.10! Please open another terminal where the `yarn` command will now be available.
12:00:32 PM: No yarn workspaces detected
12:00:32 PM: Started restoring cached node modules
12:00:32 PM: Finished restoring cached node modules
12:00:33 PM: Installing NPM modules using Yarn version 1.22.10
12:00:33 PM: yarn install v1.22.10
12:00:33 PM: [1/5] Validating package.json...
12:00:33 PM: [2/5] Resolving packages...
12:00:34 PM: [3/5] Fetching packages...
12:01:27 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
12:01:27 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
12:01:27 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
12:01:27 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
12:01:27 PM: [4/5] Linking dependencies...
12:01:27 PM: warning " > @chakra-ui/icons@1.0.13" has unmet peer dependency "@chakra-ui/system@>=1.0.0".
12:01:27 PM: warning "@chakra-ui/icons > @chakra-ui/icon@1.1.9" has unmet peer dependency "@chakra-ui/system@>=1.0.0".
12:01:27 PM: warning "next-auth > @next-auth/prisma-legacy-adapter@0.0.1-canary.127" has unmet peer dependency "@prisma/client@^2.16.1".
12:01:27 PM: warning " > babel-loader@8.2.2" has unmet peer dependency "webpack@>=2".
12:01:27 PM: warning "next-pwa > clean-webpack-plugin@3.0.0" has unmet peer dependency "webpack@*".
12:01:27 PM: warning "next-pwa > terser-webpack-plugin@5.1.1" has unmet peer dependency "webpack@^5.1.0".
12:01:27 PM: warning "next-pwa > workbox-webpack-plugin@6.1.5" has unmet peer dependency "webpack@^4.4.0 || ^5.9.0".
12:01:27 PM: warning "@storybook/addon-essentials > @storybook/addon-actions > react-inspector@5.1.0" has incorrect peer dependency "react@^16.8.4".
12:01:27 PM: warning "@storybook/addon-essentials > @storybook/api > @reach/router@1.3.4" has incorrect peer dependency "react@15.x || 16.x || 16.4.0-alpha.0911da3".
12:01:27 PM: warning "@storybook/addon-essentials > @storybook/api > @reach/router@1.3.4" has incorrect peer dependency "react-dom@15.x || 16.x || 16.4.0-alpha.0911da3".
12:01:27 PM: warning "@storybook/addon-essentials > @storybook/addon-docs > @storybook/core > @storybook/core-client@6.2.9" has unmet peer dependency "webpack@*".
12:01:27 PM: warning "@storybook/addon-essentials > @storybook/api > @reach/router > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
12:01:27 PM: warning " > babel-plugin-styled-components@1.12.0" has unmet peer dependency "styled-components@>= 2".
12:01:27 PM: warning " > jest-styled-components@7.0.4" has unmet peer dependency "styled-components@>= 5".
12:01:27 PM: warning " > storybook-addon-next-router@2.0.4" has unmet peer dependency "@storybook/addon-actions@^6.0.0".
12:01:27 PM: warning " > storybook-addon-next-router@2.0.4" has unmet peer dependency "@storybook/addons@^6.0.0".
12:01:27 PM: warning " > storybook-addon-next-router@2.0.4" has incorrect peer dependency "next@^9.0.0 || ^10.0.0".
12:02:08 PM: [5/5] Building fresh packages...
12:02:31 PM: $ husky install
12:02:31 PM: husky - Git hooks installed
12:02:31 PM: Done in 117.62s.
12:02:31 PM: NPM modules installed using Yarn
12:02:31 PM: Started restoring cached go cache
12:02:31 PM: Finished restoring cached go cache
12:02:31 PM: go version go1.14.4 linux/amd64
12:02:31 PM: go version go1.14.4 linux/amd64
12:02:31 PM: Installing missing commands
12:02:31 PM: Verify run directory
12:02:33 PM: ​
12:02:33 PM: ────────────────────────────────────────────────────────────────
12:02:33 PM:   Netlify Build                                                 
12:02:33 PM: ────────────────────────────────────────────────────────────────
12:02:33 PM: ​
12:02:33 PM: ❯ Version
12:02:33 PM:   @netlify/build 18.4.2
12:02:33 PM: ​
12:02:33 PM: ❯ Flags
12:02:33 PM:   baseRelDir: true
12:02:33 PM:   buildId: 6123b8039f5cb50007102010
12:02:33 PM:   deployId: 6123b8039f5cb50007102012
12:02:33 PM: ​
12:02:33 PM: ❯ Current directory
12:02:33 PM:   /opt/build/repo
12:02:33 PM: ​
12:02:33 PM: ❯ Config file
12:02:33 PM:   No config file was defined: using default values.
12:02:33 PM: ​
12:02:33 PM: ❯ Context
12:02:33 PM:   production
12:02:33 PM: ​
12:02:33 PM: ❯ Installing plugins
12:02:33 PM:    - @netlify/plugin-nextjs@3.8.0
12:03:02 PM: ​
12:03:02 PM: ❯ Loading plugins
12:03:02 PM:    - @netlify/plugin-nextjs@3.8.0 from Netlify app
12:03:02 PM: ​
12:03:02 PM: ────────────────────────────────────────────────────────────────
12:03:02 PM:   1. onPreBuild command from @netlify/plugin-nextjs             
12:03:02 PM: ────────────────────────────────────────────────────────────────
12:03:02 PM: ​
12:03:02 PM: Using Next.js 11.0.0
12:03:02 PM: info  - Loaded env from /opt/build/repo/.env.local
12:03:04 PM: info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
12:03:05 PM: No Next.js cache to restore.
12:03:05 PM: ​
12:03:05 PM: (@netlify/plugin-nextjs onPreBuild completed in 2.4s)
12:03:05 PM: ​
12:03:05 PM: ────────────────────────────────────────────────────────────────
12:03:05 PM:   2. Build command from Netlify app                             
12:03:05 PM: ────────────────────────────────────────────────────────────────
12:03:05 PM: ​
12:03:05 PM: $ yarn build
12:03:05 PM: yarn run v1.22.10
12:03:05 PM: $ next build
12:03:07 PM: info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
12:03:08 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
12:03:09 PM: info  - Checking validity of types...
12:03:41 PM: ./src/pages/api/auth/[...nextauth].ts
12:03:41 PM: 3:8  Warning: 'Adapters' is defined but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: ./src/components/PaymentLinkTable/index.tsx
12:03:41 PM: 5:8  Warning: 'format' is defined but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 24:10  Warning: '_' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 61:21  Warning: 'id' is defined but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 65:21  Warning: 'id' is defined but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 101:37  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: 125:29  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: ./src/components/SalesReportTable/index.tsx
12:03:41 PM: 29:9  Warning: 'period' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 88:13  Warning: 'hide' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 89:13  Warning: 'notHide' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 90:13  Warning: 'aggregateFunction' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 91:13  Warning: 'isPersistenceColumn' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 92:13  Warning: 'notAggregateFunction' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 116:33  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: ./src/components/Select/styles.ts
12:03:41 PM: 1:10  Warning: 'CSSObject' is defined but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: 3:6  Warning: 'SelectPropsType' is defined but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: ./src/components/Sidenav/NavEstablishmentPicker.tsx
12:03:41 PM: 27:34  Warning: 'selected' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: ./src/components/Sidenav/NavItem.tsx
12:03:41 PM: 6:9  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: ./src/components/Table/ColumnsIndeterminateCheckbox.tsx
12:03:41 PM: 13:21  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: ./src/components/Table/Table.tsx
12:03:41 PM: 81:10  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: ./src/components/Table/paginator/index.tsx
12:03:41 PM: 16:12  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: ./src/components/forms/PaymentLink/Basic.tsx
12:03:41 PM: 76:32  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: 79:36  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
12:03:41 PM: ./src/components/modals/PaymentLinkCreated.tsx
12:03:41 PM: 36:10  Warning: '_' is assigned a value but never used.  @typescript-eslint/no-unused-vars
12:03:41 PM: Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
12:03:41 PM: info  - Creating an optimized production build...
12:03:42 PM: > [PWA] Compile client (static)
12:03:42 PM: > [PWA] Auto register service worker with: /opt/build/repo/node_modules/next-pwa/register.js
12:03:42 PM: > [PWA] Service worker: /opt/build/repo/public/sw.js
12:03:42 PM: > [PWA]   url: /sw.js
12:03:42 PM: > [PWA]   scope: /
12:03:42 PM: > [PWA] Compile server
12:05:05 PM: info  - Compiled successfully
12:05:05 PM: info  - Collecting page data...
12:05:11 PM: info  - Generating static pages (0/10)
12:05:17 PM: info  - Generating static pages (2/10)
12:05:17 PM: info  - Generating static pages (4/10)
12:05:17 PM: info  - Generating static pages (7/10)
12:05:18 PM: info  - Generating static pages (10/10)
12:05:18 PM: info  - Finalizing page optimization...
12:05:18 PM: Page                              Size     First Load JS
12:05:18 PM: ┌ λ /                             3.36 kB         128 kB
12:05:18 PM: ├   /_app                         0 B             125 kB
12:05:18 PM: ├ ○ /404                          1.37 kB         126 kB
12:05:18 PM: ├ ○ /agenda                       286 B           235 kB
12:05:18 PM: ├ λ /api/auth/[...nextauth]       0 B             125 kB
12:05:18 PM: ├ λ /api/checkSession             0 B             125 kB
12:05:18 PM: ├ λ /auth                         2.9 kB          180 kB
12:05:18 PM: ├ ○ /cancel-sale                  295 B           235 kB
12:05:18 PM: ├ ○ /card                         287 B           235 kB
12:05:18 PM: ├ ○ /credit                       291 B           235 kB
12:05:18 PM: ├ ○ /dashboard                    4.64 kB         389 kB
12:05:18 PM: ├ ○ /payment-link                 41.4 kB         374 kB
12:05:18 PM: ├ ○ /payments                     298 B           235 kB
12:05:18 PM: └ ○ /sales-report                 3.13 kB         477 kB
12:05:18 PM: + First Load JS shared by all     125 kB
12:05:18 PM:   ├ chunks/framework.3af989.js    42.6 kB
12:05:18 PM:   ├ chunks/main.557876.js         22.3 kB
12:05:18 PM:   ├ chunks/pages/_app.706e75.js   58.9 kB
12:05:18 PM:   ├ chunks/webpack.6d72c6.js      851 B
12:05:18 PM:   └ css/e962a3d0bb07347217a5.css  2.19 kB
12:05:18 PM: λ  (Lambda)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
12:05:18 PM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
12:05:18 PM: ●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)
12:05:18 PM:    (ISR)     incremental static regeneration (uses revalidate in getStaticProps)
12:05:18 PM: Done in 132.81s.
12:05:18 PM: ​
12:05:18 PM: (build.command completed in 2m 13s)
12:05:18 PM: ​
12:05:18 PM: ────────────────────────────────────────────────────────────────
12:05:18 PM:   3. onBuild command from @netlify/plugin-nextjs                
12:05:18 PM: ────────────────────────────────────────────────────────────────
12:05:18 PM: ​
12:05:18 PM: Detected Next.js site. Copying files...
12:05:18 PM: ** Running Next on Netlify package **
12:05:18 PM: 🚀 Next on Netlify 🚀
12:05:18 PM: 🌍️ Copying public folder to /opt/build/repo/out
12:05:18 PM: 💼 Copying static NextJS assets to /opt/build/repo/out
12:05:18 PM: 💫 Setting up API endpoints as Netlify Functions in /opt/build/repo/netlify/functions
12:05:18 PM: 💫 Setting up pages with getInitialProps as Netlify Functions in /opt/build/repo/netlify/functions
12:05:18 PM: 💫 Setting up pages with getServerSideProps as Netlify Functions in /opt/build/repo/netlify/functions
12:05:18 PM: 🔥 Copying pre-rendered pages with getStaticProps and JSON data to /opt/build/repo/out
12:05:18 PM: 💫 Setting up pages with getStaticProps and fallback: true as Netlify Functions in /opt/build/repo/netlify/functions
12:05:18 PM: 💫 Setting up pages with getStaticProps and revalidation interval as Netlify Functions in /opt/build/repo/netlify/functions
12:05:18 PM: 🔥 Copying pre-rendered pages without props to /opt/build/repo/out
12:05:18 PM: Building 13 pages
12:05:18 PM: 🔀 Setting up redirects
12:05:18 PM: 🔀 Setting up headers
12:05:18 PM: ✅ Success! All done!
12:05:18 PM: ​
12:05:18 PM: (@netlify/plugin-nextjs onBuild completed in 190ms)
12:05:18 PM: ​
12:05:18 PM: ────────────────────────────────────────────────────────────────
12:05:18 PM:   4. Functions bundling                                         
12:05:18 PM: ────────────────────────────────────────────────────────────────
12:05:18 PM: ​
12:05:18 PM: Packaging Functions from netlify/functions directory:
12:05:18 PM:  - next_api_auth_nextauth/next_api_auth_nextauth.js
12:05:18 PM:  - next_api_checkSession/next_api_checkSession.js
12:05:18 PM:  - next_auth/next_auth.js
12:05:18 PM:  - next_image/next_image.js
12:05:18 PM:  - next_index/next_index.js
12:05:18 PM: ​
12:05:28 PM: ​
12:05:28 PM: ────────────────────────────────────────────────────────────────
12:05:28 PM:   Dependencies installation error                               
12:05:28 PM: ────────────────────────────────────────────────────────────────
12:05:28 PM: ​
12:05:28 PM:   Error message
12:05:28 PM:   A Netlify Function failed to require one of its dependencies.
12:05:28 PM:   Please make sure it is present in the site's top-level "package.json".​
12:05:28 PM:   In file "/opt/build/repo/netlify/functions/next_index/next_index.js"
12:05:28 PM:   Cannot find module '@prisma/client'
12:05:28 PM:   Require stack:
12:05:28 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/node_dependencies/resolve.js
12:05:28 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/node_dependencies/index.js
12:05:28 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
12:05:28 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins_core/functions/index.js
12:05:28 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/commands/get.js
12:05:28 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/core/main.js
12:05:28 PM:   - /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/core/bin.js
12:05:28 PM: ​
12:05:28 PM:   Resolved config
12:05:28 PM:   build:
12:05:28 PM:     command: yarn build
12:05:28 PM:     commandOrigin: ui
12:05:28 PM:     environment:
12:05:28 PM:       - GH_NPM_TOKEN
12:05:28 PM:       - NEXT_PUBLIC_CORE_PATH
12:05:28 PM:       - NEXT_PUBLIC_GATEWAY_URL
12:05:28 PM:       - NEXT_PUBLIC_SALE_WEB_PASS
12:05:28 PM:       - NEXT_PUBLIC_SALE_WEB_TOKEN
12:05:28 PM:       - NEXT_PUBLIC_SALE_WEB_USER
12:05:28 PM:       - NEXT_PUBLIC_SELLER_BFF
12:05:28 PM:     publish: /opt/build/repo/out
12:05:28 PM:     publishOrigin: ui
12:05:28 PM:   functionsDirectory: /opt/build/repo/netlify/functions
12:05:28 PM:   headers:
12:05:38 PM:     - for: /_next/static/chunks/*      values:        cache-control: public, max-age=31536000, immutable  plugins:    - inputs: {}      origin: ui      package: '@netlify/plugin-nextjs'  redirects:    - from: /_next/*      status: 200      to: /_next/:splat    - from: /*      status: 200      to: /index.html    - from: /      status: 200      to: /.netlify/functions/next_index    - from: /_next/data/j9Ai-LZyxG980LOOcsTOp/auth.json      status: 200      to: /.netlify/functions/next_auth    - from: /_next/data/j9Ai-LZyxG980LOOcsTOp/index.json      status: 200      to: /.netlify/functions/next_index    - from: /api/checkSession      status: 200      to: /.netlify/functions/next_api_checkSession    - from: /auth      status: 200      to: /.netlify/functions/next_auth    - force: true      from: /_next/image*      query:        q: ':quality'        url: ':url'        w: ':width'      status: 301      to: /nextimg/:url/:width/:quality    - from: /api/auth/:nextauth/*      status: 200      to: /.netlify/functions/next_api_auth_nextauth    - from: /nextimg/*      status: 200      to: /.netlify/functions/next_imageCaching artifacts
12:05:38 PM: Started saving node modules
12:05:38 PM: Finished saving node modules
12:05:38 PM: Started saving build plugins
12:05:38 PM: Finished saving build plugins
12:05:38 PM: Started saving yarn cache
12:05:52 PM: Finished saving yarn cache
12:05:52 PM: Started saving pip cache
12:05:52 PM: Finished saving pip cache
12:05:52 PM: Started saving emacs cask dependencies
12:05:52 PM: Finished saving emacs cask dependencies
12:05:52 PM: Started saving maven dependencies
12:05:52 PM: Finished saving maven dependencies
12:05:52 PM: Started saving boot dependencies
12:05:52 PM: Finished saving boot dependencies
12:05:52 PM: Started saving rust rustup cache
12:05:52 PM: Finished saving rust rustup cache
12:05:52 PM: Started saving go dependencies
12:05:52 PM: Finished saving go dependencies
12:05:55 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:05:55 PM: Creating deploy upload records
12:05:55 PM: Failing build: Failed to build site
12:05:55 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
12:05:55 PM: Finished processing build request in 5m34.209757587s

next.config.js

// eslint-disable-next-line @typescript-eslint/no-var-requires

const withPWA = require('next-pwa');

const isProd = process.env.NODE_ENV === 'production';

module.exports = withPWA({

  target: 'experimental-serverless-trace',

  pwa: {

    dest: 'public',

    disable: !isProd,

  },

  images: {

    domains: ['s3-sa-east-1.amazonaws.com'],

  },

});

Just to be sure, do you have that dependency in the top-level package.json?

No, I don’t use this dependency, but I think this is a next-auth dependency. Prisma Adapter | NextAuth.js

Hi @raisiqueira,

Looks like it’s listed in peerOptionalDependencies and thus it’s probably being skipped during installation:

Maybe add the dependency to your package.json and see if it makes a difference?