Home
Support Forums

Missing dependencies using Next 12

Hello,
I’m having trouble building a project using Next 12.0.4. There is a problem with Dependencies while building:

11:04:25 PM: Build ready to start
11:04:27 PM: build-image version: 8925038cf853b22d6397cdcb9904ac88b66bb383 (focal)
11:04:27 PM: build-image tag: v4.5.0
11:04:27 PM: buildbot version: fa6cc7f6d011b8899be97010416c5b5974d37673
11:04:27 PM: Fetching cached dependencies
11:04:27 PM: Failed to fetch cache, continuing with build
11:04:27 PM: Starting to prepare the repo for build
11:04:28 PM: No cached dependencies found. Cloning fresh repo
11:04:28 PM: git clone https://github.com/darkkatarsis/akrobatyka-panel
11:04:29 PM: Preparing Git Reference refs/heads/beta
11:04:29 PM: Parsing package.json dependencies
11:04:30 PM: Starting build script
11:04:30 PM: Installing dependencies
11:04:30 PM: Python version set to 2.7
11:04:31 PM: v16.13.0 is already installed.
11:04:32 PM: Now using node v16.13.0 (npm v8.1.0)
11:04:32 PM: Started restoring cached build plugins
11:04:32 PM: Finished restoring cached build plugins
11:04:32 PM: Attempting ruby version 2.7.2, read from environment
11:04:33 PM: Using ruby version 2.7.2
11:04:33 PM: Using PHP version 8.0
11:04:33 PM: Started restoring cached node modules
11:04:33 PM: Finished restoring cached node modules
11:04:34 PM: Installing NPM modules using NPM version 8.1.0
11:04:35 PM: npm WARN old lockfile
11:04:35 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
11:04:35 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
11:04:35 PM: npm WARN old lockfile
11:04:35 PM: npm WARN old lockfile This is a one-time fix-up, please be patient...
11:04:35 PM: npm WARN old lockfile
11:05:00 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
11:05:15 PM: added 889 packages, and audited 890 packages in 40s
11:05:15 PM: 142 packages are looking for funding
11:05:15 PM:   run `npm fund` for details
11:05:15 PM: 10 moderate severity vulnerabilities
11:05:15 PM: To address all issues (including breaking changes), run:
11:05:15 PM:   npm audit fix --force
11:05:15 PM: Run `npm audit` for details.
11:05:15 PM: NPM modules installed
11:05:15 PM: Started restoring cached go cache
11:05:15 PM: Finished restoring cached go cache
11:05:15 PM: go version go1.16.5 linux/amd64
11:05:15 PM: go version go1.16.5 linux/amd64
11:05:15 PM: Installing missing commands
11:05:15 PM: Verify run directory
11:05:16 PM: ​
11:05:16 PM: ────────────────────────────────────────────────────────────────
11:05:16 PM:   Netlify Build                                                 
11:05:16 PM: ────────────────────────────────────────────────────────────────
11:05:16 PM: ​
11:05:16 PM: ❯ Version
11:05:16 PM:   @netlify/build 18.25.2
11:05:17 PM: ​
11:05:17 PM: ❯ Flags
11:05:17 PM:   baseRelDir: true
11:05:17 PM:   buildId: 619c13e98192600007ae5228
11:05:17 PM:   deployId: 619c13e98192600007ae522a
11:05:17 PM: ​
11:05:17 PM: ❯ Current directory
11:05:17 PM:   /opt/build/repo
11:05:17 PM: ​
11:05:17 PM: ❯ Config file
11:05:17 PM:   No config file was defined: using default values.
11:05:17 PM: ​
11:05:17 PM: ❯ Context
11:05:17 PM:   production
11:05:17 PM: ​
11:05:17 PM: ❯ Installing plugins
11:05:17 PM:    - @netlify/plugin-nextjs@3.9.2
11:05:25 PM: ​
11:05:25 PM: ❯ Loading plugins
11:05:25 PM:    - @netlify/plugin-nextjs@3.9.2 from Netlify app
11:05:26 PM: ​
11:05:26 PM: ────────────────────────────────────────────────────────────────
11:05:26 PM:   1. @netlify/plugin-nextjs (onPreBuild event)                  
11:05:26 PM: ────────────────────────────────────────────────────────────────
11:05:26 PM: ​
11:05:26 PM: Using Next.js 12.0.4
11:05:26 PM: Warning: support for Next.js >=11.1.0 is experimental
11:05:27 PM: The "target" config property must be one of "serverless", "experimental-serverless-trace". Building with "serverless" target.
11:05:27 PM: No Next.js cache to restore.
11:05:27 PM: ​
11:05:27 PM: (@netlify/plugin-nextjs onPreBuild completed in 1.2s)
11:05:27 PM: ​
11:05:27 PM: ────────────────────────────────────────────────────────────────
11:05:27 PM:   2. Build command from Netlify app                             
11:05:27 PM: ────────────────────────────────────────────────────────────────
11:05:27 PM: ​
11:05:27 PM: $ npm run build
11:05:27 PM: > akrobatyka-trojmiasto-panel@0.1.0 build
11:05:27 PM: > next build
11:05:29 PM: info  - Checking validity of types...
11:05:33 PM: ./pages/presence/[id].js
11:05:33 PM: 78:6  Warning: React Hook useEffect has missing dependencies: 'childrenData', 'currentSeason', and 'router.query.id'. Either include them or remove the dependency array. If 'setPresenceList' needs the current value of 'childrenData', you can also switch to useReducer instead of useState and read 'childrenData' in the reducer.  react-hooks/exhaustive-deps
11:05:33 PM: info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
11:05:33 PM: info  - Creating an optimized production build...
11:05:34 PM: > [PWA] Compile client (static)
11:05:34 PM: > [PWA] Auto register service worker with: /opt/build/repo/node_modules/next-pwa/register.js
11:05:34 PM: > [PWA] Service worker: /opt/build/repo/public/sw.js
11:05:34 PM: > [PWA]   url: /sw.js
11:05:34 PM: > [PWA]   scope: /
11:05:34 PM: > [PWA] Fallback to precache routes when fetch failed from cache or network:
11:05:34 PM: > [PWA]   document (page): /_offline
11:05:34 PM: > [PWA] Compile server
11:06:36 PM: warn  - Compiled with warnings
11:06:36 PM: ./node_modules/next-i18next/dist/commonjs/serverSideTranslations.js
11:06:36 PM: Critical dependency: the request of a dependency is an expression
11:06:36 PM: Import trace for requested module:
11:06:36 PM: ./node_modules/next-i18next/serverSideTranslations.js
11:06:36 PM: ./pages/customers/index.js
11:06:36 PM: ./node_modules/next/dist/build/webpack/loaders/next-serverless-loader/index.js?page=%2Fcustomers&absolutePagePath=private-next-pages%2Fcustomers%2Findex.js&absoluteAppPath=private-next-pages%2F_app.js&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=zyFyxdRRBFdiDMza0K1cp&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22e54d40e17f65e904ced5761a8cad7b54%22%2C%22previewModeSigningKey%22%3A%2231aaf1507e785bc9b49e704ea55e46331001b538397c8f64b77378f56a8a7381%22%2C%22previewModeEncryptionKey%22%3A%22f24e106b12024f02dda790e5ddab91b04cd43549c9d1bd41f0f7ecc5dc19556b%22%7D&loadedEnvFiles=W10%3D&i18n=%7B%22defaultLocale%22%3A%22en%22%2C%22locales%22%3A%5B%22en%22%2C%22pl%22%5D%2C%22localePath%22%3A%22%2Fopt%2Fbuild%2Frepo%2Fpublic%2Flocales%22%7D!
11:06:36 PM: ./node_modules/keyv/src/index.js
11:06:36 PM: Critical dependency: the request of a dependency is an expression
11:06:36 PM: Import trace for requested module:
11:06:36 PM: ./node_modules/cacheable-request/src/index.js
11:06:36 PM: ./node_modules/got/dist/source/core/index.js
11:06:36 PM: ./node_modules/got/dist/source/create.js
11:06:36 PM: ./node_modules/got/dist/source/index.js
11:06:36 PM: ./node_modules/openid-client/lib/helpers/request.js
11:06:36 PM: ./node_modules/openid-client/lib/index.js
11:06:36 PM: ./node_modules/next-auth/server/lib/oauth/callback.js
11:06:36 PM: ./node_modules/next-auth/server/routes/callback.js
11:06:36 PM: ./node_modules/next-auth/server/routes/index.js
11:06:36 PM: ./node_modules/next-auth/server/index.js
11:06:36 PM: ./node_modules/next-auth/index.js
11:06:36 PM: ./pages/api/auth/[...nextauth].js
11:06:36 PM: ./node_modules/next/dist/build/webpack/loaders/next-serverless-loader/index.js?page=%2Fapi%2Fauth%2F%5B...nextauth%5D&absolutePagePath=private-next-pages%2Fapi%2Fauth%2F%5B...nextauth%5D.js&absoluteAppPath=private-next-pages%2F_app.js&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=zyFyxdRRBFdiDMza0K1cp&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22e54d40e17f65e904ced5761a8cad7b54%22%2C%22previewModeSigningKey%22%3A%2231aaf1507e785bc9b49e704ea55e46331001b538397c8f64b77378f56a8a7381%22%2C%22previewModeEncryptionKey%22%3A%22f24e106b12024f02dda790e5ddab91b04cd43549c9d1bd41f0f7ecc5dc19556b%22%7D&loadedEnvFiles=W10%3D&i18n=%7B%22defaultLocale%22%3A%22en%22%2C%22locales%22%3A%5B%22en%22%2C%22pl%22%5D%2C%22localePath%22%3A%22%2Fopt%2Fbuild%2Frepo%2Fpublic%2Flocales%22%7D!
11:06:36 PM: ./node_modules/mongodb/lib/bson.js
11:06:36 PM: Module not found: Can't resolve 'bson-ext' in '/opt/build/repo/node_modules/mongodb/lib'
11:06:36 PM: Import trace for requested module:
11:06:36 PM: ./node_modules/mongodb/lib/index.js
11:06:36 PM: ./pages/api/auth.js
11:06:36 PM: ./node_modules/next/dist/build/webpack/loaders/next-serverless-loader/index.js?page=%2Fapi%2Fauth&absolutePagePath=private-next-pages%2Fapi%2Fauth.js&absoluteAppPath=private-next-pages%2F_app.js&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=zyFyxdRRBFdiDMza0K1cp&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22e54d40e17f65e904ced5761a8cad7b54%22%2C%22previewModeSigningKey%22%3A%2231aaf1507e785bc9b49e704ea55e46331001b538397c8f64b77378f56a8a7381%22%2C%22previewModeEncryptionKey%22%3A%22f24e106b12024f02dda790e5ddab91b04cd43549c9d1bd41f0f7ecc5dc19556b%22%7D&loadedEnvFiles=W10%3D&i18n=%7B%22defaultLocale%22%3A%22en%22%2C%22locales%22%3A%5B%22en%22%2C%22pl%22%5D%2C%22localePath%22%3A%22%2Fopt%2Fbuild%2Frepo%2Fpublic%2Flocales%22%7D!
11:06:36 PM: ./node_modules/mongodb/lib/deps.js
11:06:36 PM: Module not found: Can't resolve 'kerberos' in '/opt/build/repo/node_modules/mongodb/lib'
11:06:36 PM: Import trace for requested module:
11:06:36 PM: ./node_modules/mongodb/lib/index.js
11:06:36 PM: ./pages/api/auth.js
11:06:36 PM: ./node_modules/next/dist/build/webpack/loaders/next-serverless-loader/index.js?page=%2Fapi%2Fauth&absolutePagePath=private-next-pages%2Fapi%2Fauth.js&absoluteAppPath=private-next-pages%2F_app.js&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=zyFyxdRRBFdiDMza0K1cp&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22e54d40e17f65e904ced5761a8cad7b54%22%2C%22previewModeSigningKey%22%3A%2231aaf1507e785bc9b49e704ea55e46331001b538397c8f64b77378f56a8a7381%22%2C%22previewModeEncryptionKey%22%3A%22f24e106b12024f02dda790e5ddab91b04cd43549c9d1bd41f0f7ecc5dc19556b%22%7D&loadedEnvFiles=W10%3D&i18n=%7B%22defaultLocale%22%3A%22en%22%2C%22locales%22%3A%5B%22en%22%2C%22pl%22%5D%2C%22localePath%22%3A%22%2Fopt%2Fbuild%2Frepo%2Fpublic%2Flocales%22%7D!
11:06:36 PM: ./node_modules/mongodb/lib/deps.js
11:06:36 PM: Module not found: Can't resolve 'snappy' in '/opt/build/repo/node_modules/mongodb/lib'
11:06:36 PM: Import trace for requested module:
11:06:36 PM: ./node_modules/mongodb/lib/index.js
11:06:36 PM: ./pages/api/auth.js
11:06:36 PM: ./node_modules/next/dist/build/webpack/loaders/next-serverless-loader/index.js?page=%2Fapi%2Fauth&absolutePagePath=private-next-pages%2Fapi%2Fauth.js&absoluteAppPath=private-next-pages%2F_app.js&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=zyFyxdRRBFdiDMza0K1cp&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22e54d40e17f65e904ced5761a8cad7b54%22%2C%22previewModeSigningKey%22%3A%2231aaf1507e785bc9b49e704ea55e46331001b538397c8f64b77378f56a8a7381%22%2C%22previewModeEncryptionKey%22%3A%22f24e106b12024f02dda790e5ddab91b04cd43549c9d1bd41f0f7ecc5dc19556b%22%7D&loadedEnvFiles=W10%3D&i18n=%7B%22defaultLocale%22%3A%22en%22%2C%22locales%22%3A%5B%22en%22%2C%22pl%22%5D%2C%22localePath%22%3A%22%2Fopt%2Fbuild%2Frepo%2Fpublic%2Flocales%22%7D!
11:06:36 PM: ./node_modules/mongodb/lib/deps.js
11:06:36 PM: Module not found: Can't resolve 'snappy/package.json' in '/opt/build/repo/node_modules/mongodb/lib'
11:06:36 PM: Import trace for requested module:
11:06:36 PM: ./node_modules/mongodb/lib/index.js
11:06:36 PM: ./pages/api/auth.js
11:06:36 PM: ./node_modules/next/dist/build/webpack/loaders/next-serverless-loader/index.js?page=%2Fapi%2Fauth&absolutePagePath=private-next-pages%2Fapi%2Fauth.js&absoluteAppPath=private-next-pages%2F_app.js&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=zyFyxdRRBFdiDMza0K1cp&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22e54d40e17f65e904ced5761a8cad7b54%22%2C%22previewModeSigningKey%22%3A%2231aaf1507e785bc9b49e704ea55e46331001b538397c8f64b77378f56a8a7381%22%2C%22previewModeEncryptionKey%22%3A%22f24e106b12024f02dda790e5ddab91b04cd43549c9d1bd41f0f7ecc5dc19556b%22%7D&loadedEnvFiles=W10%3D&i18n=%7B%22defaultLocale%22%3A%22en%22%2C%22locales%22%3A%5B%22en%22%2C%22pl%22%5D%2C%22localePath%22%3A%22%2Fopt%2Fbuild%2Frepo%2Fpublic%2Flocales%22%7D!
11:06:36 PM: ./node_modules/mongodb/lib/deps.js
11:06:36 PM: Module not found: Can't resolve 'aws4' in '/opt/build/repo/node_modules/mongodb/lib'
11:06:36 PM: Import trace for requested module:
11:06:36 PM: ./node_modules/mongodb/lib/index.js
11:06:36 PM: ./pages/api/auth.js
11:06:36 PM: ./node_modules/next/dist/build/webpack/loaders/next-serverless-loader/index.js?page=%2Fapi%2Fauth&absolutePagePath=private-next-pages%2Fapi%2Fauth.js&absoluteAppPath=private-next-pages%2F_app.js&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=zyFyxdRRBFdiDMza0K1cp&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22e54d40e17f65e904ced5761a8cad7b54%22%2C%22previewModeSigningKey%22%3A%2231aaf1507e785bc9b49e704ea55e46331001b538397c8f64b77378f56a8a7381%22%2C%22previewModeEncryptionKey%22%3A%22f24e106b12024f02dda790e5ddab91b04cd43549c9d1bd41f0f7ecc5dc19556b%22%7D&loadedEnvFiles=W10%3D&i18n=%7B%22defaultLocale%22%3A%22en%22%2C%22locales%22%3A%5B%22en%22%2C%22pl%22%5D%2C%22localePath%22%3A%22%2Fopt%2Fbuild%2Frepo%2Fpublic%2Flocales%22%7D!
11:06:36 PM: ./node_modules/mongodb/lib/encrypter.js
11:06:36 PM: Module not found: Can't resolve 'mongodb-client-encryption' in '/opt/build/repo/node_modules/mongodb/lib'
11:06:36 PM: Import trace for requested module:
11:06:36 PM: ./node_modules/mongodb/lib/connection_string.js
11:06:36 PM: ./node_modules/mongodb/lib/mongo_client.js
11:06:36 PM: ./node_modules/mongodb/lib/index.js
11:06:36 PM: ./pages/api/auth.js
11:06:36 PM: ./node_modules/next/dist/build/webpack/loaders/next-serverless-loader/index.js?page=%2Fapi%2Fauth&absolutePagePath=private-next-pages%2Fapi%2Fauth.js&absoluteAppPath=private-next-pages%2F_app.js&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&absoluteErrorPath=next%2Fdist%2Fpages%2F_error&absolute404Path=&distDir=private-dot-next&buildId=zyFyxdRRBFdiDMza0K1cp&assetPrefix=&generateEtags=true&poweredByHeader=true&canonicalBase=&basePath=&runtimeConfig=&previewProps=%7B%22previewModeId%22%3A%22e54d40e17f65e904ced5761a8cad7b54%22%2C%22previewModeSigningKey%22%3A%2231aaf1507e785bc9b49e704ea55e46331001b538397c8f64b77378f56a8a7381%22%2C%22previewModeEncryptionKey%22%3A%22f24e106b12024f02dda790e5ddab91b04cd43549c9d1bd41f0f7ecc5dc19556b%22%7D&loadedEnvFiles=W10%3D&i18n=%7B%22defaultLocale%22%3A%22en%22%2C%22locales%22%3A%5B%22en%22%2C%22pl%22%5D%2C%22localePath%22%3A%22%2Fopt%2Fbuild%2Frepo%2Fpublic%2Flocales%22%7D!
11:06:36 PM: ./node_modules/i18next-fs-backend/cjs/readFile.js
11:06:36 PM: Critical dependency: the request of a dependency is an expression

..... Cutted due the number of characters.....

11:06:36 PM: info  - Collecting page data...
11:06:44 PM: info  - Generating static pages (0/9)
11:06:44 PM: info  - Generating static pages (2/9)
11:06:44 PM: info  - Generating static pages (4/9)
11:06:44 PM: info  - Generating static pages (6/9)
11:06:44 PM: info  - Generating static pages (9/9)
11:06:44 PM: info  - Finalizing page optimization...
11:06:44 PM: Page                                       Size     First Load JS
11:06:44 PM: β”Œ Ξ» /                                      24.5 kB         203 kB
11:06:44 PM: β”œ   β”” css/b0e9b9c01af51025.css             128 B
11:06:44 PM: β”œ   /_app                                  0 B             141 kB
11:06:44 PM: β”œ β—‹ /_offline                              4.18 kB         145 kB
11:06:44 PM: β”œ β—‹ /404                                   195 B           141 kB
11:06:44 PM: β”œ Ξ» /api/auth                              0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/auth/[...nextauth]                0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/children                          0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/customer                          0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/editor/groups                     0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/groups                            0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/payment                           0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/presence                          0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/season                            0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/user                              0 B             141 kB
11:06:44 PM: β”œ Ξ» /api/users                             0 B             141 kB
11:06:44 PM: β”œ Ξ» /customer/[id]                         3.92 kB         216 kB
11:06:44 PM: β”œ Ξ» /customer/add                          4.1 kB          217 kB
11:06:44 PM: β”œ Ξ» /customers                             3.85 kB         272 kB
11:06:44 PM: β”œ Ξ» /group/[id]                            2.51 kB         223 kB
11:06:44 PM: β”œ Ξ» /group/add                             2.46 kB         223 kB
11:06:44 PM: β”œ Ξ» /group/list/[id]                       11.1 kB         296 kB
11:06:44 PM: β”œ Ξ» /groups                                6.49 kB         184 kB
11:06:44 PM: β”œ Ξ» /presence/[id]                         28.6 kB         232 kB
11:06:44 PM: β”œ Ξ» /season/add                            1.88 kB         212 kB
11:06:44 PM: β”œ Ξ» /seasons                               5.25 kB         178 kB
11:06:44 PM: β”œ Ξ» /user/[id]                             2.04 kB         212 kB
11:06:44 PM: β”œ Ξ» /user/add                              2.07 kB         212 kB
11:06:44 PM: β”” Ξ» /users                                 6.26 kB         184 kB
11:06:44 PM: + First Load JS shared by all              141 kB
11:06:44 PM:   β”œ chunks/framework-91d7f78b5b4003c8.js   42 kB
11:06:44 PM:   β”œ chunks/main-e0941fa451b2afa3.js        31 kB
11:06:44 PM:   β”œ chunks/pages/_app-5e9e125260b3786c.js  66.7 kB
11:06:44 PM:   β”œ chunks/webpack-2392ddee38557cd3.js     993 B
11:06:44 PM:   β”” css/7e7c221ce6cf9883.css               284 B
11:06:44 PM: Ξ»  (Lambda)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
11:06:44 PM: β—‹  (Static)  automatically rendered as static HTML (uses no initial props)
11:06:44 PM: ​
11:06:44 PM: (build.command completed in 1m 17.4s)
11:06:44 PM: ​
11:06:44 PM: ────────────────────────────────────────────────────────────────
11:06:44 PM:   3. @netlify/plugin-nextjs (onBuild event)                     
11:06:44 PM: ────────────────────────────────────────────────────────────────
11:06:44 PM: ​
11:06:44 PM: Detected Next.js site. Copying files...
11:06:44 PM: ** Running Next on Netlify package **
11:06:44 PM: πŸš€ Next on Netlify πŸš€
11:06:44 PM: 🌍️ Copying public folder to /opt/build/repo
11:06:44 PM: πŸ’Ό Copying static NextJS assets to /opt/build/repo
11:06:44 PM: πŸ’« Setting up API endpoints as Netlify Functions in /opt/build/repo/.netlify/functions-internal
11:06:44 PM: πŸ’« Setting up pages with getInitialProps as Netlify Functions in /opt/build/repo/.netlify/functions-internal
11:06:44 PM: πŸ’« Setting up pages with getServerSideProps as Netlify Functions in /opt/build/repo/.netlify/functions-internal
11:06:44 PM: πŸ”₯ Copying pre-rendered pages with getStaticProps and JSON data to /opt/build/repo
11:06:44 PM: πŸ’« Setting up pages with getStaticProps and fallback: true as Netlify Functions in /opt/build/repo/.netlify/functions-internal
11:06:44 PM: πŸ’« Setting up pages with getStaticProps and revalidation interval as Netlify Functions in /opt/build/repo/.netlify/functions-internal
11:06:44 PM: πŸ”₯ Copying pre-rendered pages without props to /opt/build/repo
11:06:44 PM: Building 31 pages
11:06:45 PM: πŸ”€ Setting up redirects
11:06:45 PM: πŸ”€ Setting up headers
11:06:45 PM: βœ… Success! All done!
11:06:45 PM: ​
11:06:45 PM: (@netlify/plugin-nextjs onBuild completed in 802ms)
11:06:45 PM: ​
11:06:45 PM: ────────────────────────────────────────────────────────────────
11:06:45 PM:   4. Functions bundling                                         
11:06:45 PM: ────────────────────────────────────────────────────────────────
11:06:45 PM: ​
11:06:45 PM: Packaging Functions from .netlify/functions-internal directory:
11:06:45 PM:  - next_api_auth/next_api_auth.js
11:06:45 PM:  - next_api_auth_nextauth/next_api_auth_nextauth.js
11:06:45 PM:  - next_api_children/next_api_children.js
11:06:45 PM:  - next_api_customer/next_api_customer.js
11:06:45 PM:  - next_api_editor_groups/next_api_editor_groups.js
11:06:45 PM:  - next_api_groups/next_api_groups.js
11:06:45 PM:  - next_api_payment/next_api_payment.js
11:06:45 PM:  - next_api_presence/next_api_presence.js
11:06:45 PM:  - next_api_season/next_api_season.js
11:06:45 PM:  - next_api_user/next_api_user.js
11:06:45 PM:  - next_api_users/next_api_users.js
11:06:45 PM:  - next_customer_add/next_customer_add.js
11:06:45 PM:  - next_customer_id/next_customer_id.js
11:06:45 PM:  - next_customers/next_customers.js
11:06:45 PM:  - next_group_add/next_group_add.js
11:06:45 PM:  - next_group_id/next_group_id.js
11:06:45 PM:  - next_group_list_id/next_group_list_id.js
11:06:45 PM:  - next_groups/next_groups.js
11:06:45 PM:  - next_image/next_image.js
11:06:45 PM:  - next_index/next_index.js
11:06:45 PM:  - next_presence_id/next_presence_id.js
11:06:45 PM:  - next_season_add/next_season_add.js
11:06:45 PM:  - next_seasons/next_seasons.js
11:06:45 PM:  - next_user_add/next_user_add.js
11:06:45 PM:  - next_user_id/next_user_id.js
11:06:45 PM:  - next_users/next_users.js
11:06:45 PM: ​
11:06:54 PM: ​
11:06:54 PM: ────────────────────────────────────────────────────────────────
11:06:54 PM:   Dependencies installation error                               
11:06:54 PM: ────────────────────────────────────────────────────────────────
11:06:54 PM: ​
11:06:54 PM:   Error message
11:06:54 PM:   A Netlify Function failed to require one of its dependencies.
11:06:54 PM:   Please make sure it is present in the site's top-level "package.json".
​
11:06:54 PM:   In file "/opt/build/repo/.netlify/functions-internal/next_customer_add/next_customer_add.js"
11:06:54 PM:   Cannot find module '../../webpack-runtime.js' from '/opt/build/repo/.netlify/functions-internal/next_customer_add/nextPage/pages/customer'
11:06:54 PM: ​
11:06:54 PM:   Resolved config
11:06:54 PM:   build:
11:06:54 PM:     command: npm run build
11:06:54 PM:     commandOrigin: ui
11:06:54 PM:     publish: /opt/build/repo
11:06:54 PM:     publishOrigin: default
11:06:54 PM:   functions:
11:06:54 PM:     '*':
11:06:54 PM:       included_files:
11:06:54 PM:         - '!node_modules/@next/swc-*/**/*'
11:06:54 PM:         - '!node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*'
11:06:54 PM:   headers:
11:06:57 PM:     - for: /_next/static/chunks/*
      values:
        cache-control: public, max-age=31536000, immutable
  plugins:
    - inputs: {}
      origin: ui
      package: '@netlify/plugin-nextjs'
  redirects:

..... Cutted due the number of characters.....

11:06:58 PM: Started saving go dependencies
11:06:58 PM: Finished saving go dependencies
11:07:00 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:07:00 PM: Creating deploy upload records
11:07:00 PM: Failing build: Failed to build site
11:07:00 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
11:07:00 PM: Finished processing build request in 2m32.868258762s

The project is built correctly on vercel and locally. I noticed that changing the version to Next to 11.0.1 and installing missing packages solves the problem. However, I am not entirely satisfied with this solution because I cannot use, for example, Middleware. Is there a chance to do something about it?

Project name: https://beta-akrobatyka-panel.netlify.app

package.json

{
  "name": "akrobatyka-trojmiasto-panel",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@date-io/moment": "^2.11.0",
    "@emotion/react": "^11.6.0",
    "@emotion/styled": "^11.6.0",
    "@fontsource/roboto": "^4.5.0",
    "@hookform/resolvers": "^2.8.3",
    "@mui/icons-material": "^5.1.1",
    "@mui/lab": "^5.0.0-alpha.55",
    "@mui/material": "^5.1.1",
    "@mui/styles": "^5.1.1",
    "@mui/x-data-grid": "^5.0.1",
    "@svgr/webpack": "^5.5.0",
    "full-icu": "^1.3.4",
    "js-cookie": "^3.0.1",
    "lottie-react-native": "^5.0.1",
    "moment": "^2.29.1",
    "mongodb": "^4.2.0",
    "next": "^12.0.4",
    "next-auth": "^4.0.0-next.26",
    "next-i18next": "^9.1.0",
    "nextjs-progressbar": "0.0.11",
    "react": "^17.0.2",
    "react-detect-offline": "^2.4.5",
    "react-dom": "^17.0.2",
    "react-hook-form": "^7.20.2",
    "react-lottie-player": "^1.4.1",
    "sass": "^1.43.4",
    "yup": "^0.32.9"
  },
  "devDependencies": {
    "eslint": "7.32.0",
    "eslint-config-next": "11.1.2",
    "json-schema": "^0.4.0",
    "jsonpointer": "^5.0.0",
    "next-pwa": "^5.4.1",
    "nth-check": "^2.0.1"
  }
}

Hi @darkkatarsis,

You need to use version 4 of the plugin:

Also, since you plan to use Middleware, do give this a read:

1 Like

@hrishikesh ok now i have plugin version ^4.0.0-beta.11. Build is Published.

1 Like

Glad everything is working now! Thanks for letting us know!