Site name: sterah.netlify.app
Deploy log
5:26:12 PM: build-image version: ecdc8b770f4a0193fd3f258c1bc6029e681813a4 (focal)
5:26:12 PM: buildbot version: b493cb80d7a9816d9291dcd152b1c985c05217f4
5:26:12 PM: Fetching cached dependencies
5:26:12 PM: Starting to download cache of 505.9MB
5:26:14 PM: Finished downloading cache in 1.897s
5:26:14 PM: Starting to extract cache
5:26:17 PM: Finished extracting cache in 2.705s
5:26:17 PM: Finished fetching cache in 4.675s
5:26:17 PM: Starting to prepare the repo for build
5:26:18 PM: Preparing Git Reference refs/heads/main
5:26:20 PM: Starting to install dependencies
5:26:20 PM: Python version set to 3.8
5:26:20 PM: Attempting Ruby version 2.7.2, read from environment
5:26:21 PM: Using Ruby version 2.7.2
5:26:21 PM: Started restoring cached go cache
5:26:21 PM: Finished restoring cached go cache
5:26:22 PM: go version go1.19.13 linux/amd64
5:26:23 PM: Using PHP version 8.0
5:26:24 PM: Started restoring cached Node.js version
5:26:25 PM: Finished restoring cached Node.js version
5:26:25 PM: v18.20.4 is already installed.
5:26:26 PM: Now using node v18.20.4 (npm v10.7.0)
5:26:26 PM: Enabling Node.js Corepack
5:26:26 PM: Started restoring cached build plugins
5:26:26 PM: Finished restoring cached build plugins
5:26:26 PM: Started restoring cached corepack dependencies
5:26:26 PM: Finished restoring cached corepack dependencies
5:26:26 PM: No npm workspaces detected
5:26:26 PM: Started restoring cached node modules
5:26:26 PM: Finished restoring cached node modules
5:26:26 PM: Installing npm packages using npm version 10.7.0
5:26:27 PM: up to date, audited 502 packages in 1s
5:26:27 PM: 202 packages are looking for funding
5:26:27 PM: run `npm fund` for details
5:26:27 PM: 1 moderate severity vulnerability
5:26:27 PM: To address all issues, run:
5:26:27 PM: npm audit fix
5:26:27 PM: Run `npm audit` for details.
5:26:27 PM: npm packages installed
5:26:27 PM: Successfully installed dependencies
5:26:28 PM: Starting build script
5:26:29 PM: Detected 1 framework(s)
5:26:29 PM: "next" at version "14.2.5"
5:26:29 PM: Section completed: initializing
5:26:30 PM:
5:26:30 PM: Netlify Build
5:26:30 PM: ────────────────────────────────────────────────────────────────
5:26:30 PM:
5:26:30 PM: ❯ Version
5:26:30 PM: @netlify/build 29.54.1
5:26:30 PM:
5:26:30 PM: ❯ Flags
5:26:30 PM: accountId: 61f9ce316fe96a4200020cfa
5:26:30 PM: baseRelDir: true
5:26:30 PM: buildId: 66df59d7c8b38d00084cc306
5:26:30 PM: deployId: 66df59d7c8b38d00084cc308
5:26:30 PM:
5:26:30 PM: ❯ Current directory
5:26:30 PM: /opt/build/repo
5:26:30 PM:
5:26:30 PM: ❯ Config file
5:26:30 PM: No config file was defined: using default values.
5:26:30 PM:
5:26:30 PM: ❯ Context
5:26:30 PM: production
5:26:30 PM:
5:26:30 PM: ❯ Using Next.js Runtime - v5.7.1
5:26:32 PM: Next.js cache restored
5:26:32 PM:
5:26:32 PM: Build command from Netlify app
5:26:32 PM: ────────────────────────────────────────────────────────────────
5:26:32 PM:
5:26:32 PM: $ npm run build
5:26:32 PM: > sterah-v2@0.1.0 build
5:26:32 PM: > next build
5:26:32 PM: ⚠ Invalid next.config.mjs options detected:
5:26:32 PM: ⚠ Unrecognized key(s) in object: 'api'
5:26:32 PM: ⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
5:26:32 PM: ▲ Next.js 14.2.5
5:26:32 PM: - Environments: .env
5:26:32 PM: Linting and checking validity of types ...
5:26:34 PM: Creating an optimized production build ...
5:26:43 PM: ✓ Compiled successfully
5:26:43 PM: Collecting page data ...
5:26:44 PM: Generating static pages (0/7) ...
5:26:44 PM: Generating static pages (1/7)
5:26:44 PM: Warning: data for page "/midias" is 399 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance.
5:26:44 PM: See more info here: https://nextjs.org/docs/messages/large-page-data
5:26:44 PM: Generating static pages (3/7)
5:26:44 PM: Generating static pages (5/7)
5:26:44 PM: Warning: data for page "/" is 404 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance.
5:26:44 PM: See more info here: https://nextjs.org/docs/messages/large-page-data
5:26:44 PM: ✓ Generating static pages (7/7)
5:26:46 PM: Finalizing page optimization ...
5:26:46 PM: Collecting build traces ...
5:26:56 PM: Route (pages) Size First Load JS
5:26:56 PM: ┌ ● / (580 ms) 44.3 kB 171 kB
5:26:56 PM: ├ /_app 0 B 95.4 kB
5:26:56 PM: ├ ○ /404 180 B 95.6 kB
5:26:56 PM: ├ ƒ /api/sendMail 0 B 95.4 kB
5:26:56 PM: ├ ● /contato (374 ms) 64.8 kB 191 kB
5:26:56 PM: ├ ● /midias (320 ms) 2.35 kB 122 kB
5:26:56 PM: ├ ƒ /midias/[slug] 2.05 kB 155 kB
5:26:56 PM: ├ ● /procedimentos (313 ms) 2.54 kB 122 kB
5:26:56 PM: ├ ƒ /procedimentos/[...slug] 6.89 kB 160 kB
5:26:56 PM: └ ● /sterah (308 ms) 27 kB 146 kB
5:26:56 PM: └ css/07a098635536dd3e.css 2.86 kB
5:26:56 PM: + First Load JS shared by all 98.3 kB
5:26:56 PM: ├ chunks/framework-ecc4130bc7a58a64.js 45.2 kB
5:26:56 PM: ├ chunks/main-ac52e5f1ea1d2a16.js 32 kB
5:26:56 PM: ├ chunks/pages/_app-c354663304422097.js 17.2 kB
5:26:56 PM: └ other shared chunks (total) 3.94 kB
5:26:56 PM: ○ (Static) prerendered as static content
5:26:56 PM: ● (SSG) prerendered as static HTML (uses getStaticProps)
5:26:56 PM: ƒ (Dynamic) server-rendered on demand
5:26:56 PM:
5:26:56 PM: (build.command completed in 24.6s)
5:26:56 PM: Next.js cache saved
5:26:58 PM:
5:26:58 PM: Functions bundling
5:26:58 PM: ────────────────────────────────────────────────────────────────
5:26:58 PM:
5:26:58 PM: Packaging Functions from .netlify/functions-internal directory:
5:26:58 PM: - ___netlify-server-handler/___netlify-server-handler.mjs
5:26:58 PM:
5:27:07 PM:
5:27:07 PM: (Functions bundling completed in 9s)
5:27:08 PM:
5:27:08 PM: Deploy site
5:27:08 PM: ────────────────────────────────────────────────────────────────
5:27:08 PM:
5:27:08 PM: Starting to deploy site from '.next'
5:27:08 PM: Calculating files to upload
5:27:08 PM: 0 new file(s) to upload
5:27:08 PM: 1 new function(s) to upload
5:27:17 PM: Failed to create function on AWS Lambda: invalid parameter for lambda creation: Unzipped size must be smaller than 262144000 bytes
5:27:17 PM: Failed to upload file: ___netlify-server-handler
5:27:17 PM: Section completed: deploying
5:27:17 PM:
5:27:17 PM: Error deploying
5:27:17 PM: ────────────────────────────────────────────────────────────────
5:27:17 PM:
5:27:17 PM: Error message
5:27:17 PM: Deploy did not succeed with HTTP Error 400: [PUT /deploys/{deploy_id}/functions/{name}][400] uploadDeployFunction default &{Code:400 Message:Failed to create function on AWS Lambda: invalid parameter for lambda creation: Unzipped size must be smaller than 262144000 bytes}
5:27:17 PM:
5:27:17 PM: Error location
5:27:17 PM: At deploy the stage with HTTP status code '400'
5:27:17 PM:
5:27:17 PM: Resolved config
5:27:17 PM: build:
5:27:17 PM: command: npm run build
5:27:17 PM: commandOrigin: ui
5:27:17 PM: environment:
5:27:17 PM: - SENDGRID_API_KEY
5:27:17 PM: publish: /opt/build/repo/.next
5:27:17 PM: publishOrigin: ui
5:27:17 PM: plugins:
5:27:17 PM: - inputs: {}
5:27:17 PM: origin: ui
5:27:17 PM: package: '@netlify/plugin-nextjs'
5:27:17 PM: redirects:
5:27:17 PM: - from: /_next/image
5:27:17 PM: query:
5:27:17 PM: q: ':quality'
5:27:17 PM: url: ':url'
5:27:17 PM: w: ':width'
5:27:17 PM: status: 200
5:27:17 PM: to: /.netlify/images?url=:url&w=:width&q=:quality
5:27:18 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
5:27:18 PM: - from: /_ipx/*
query:
q: ':quality'
url: ':url'
w: ':width'
status: 200
to: /.netlify/images?url=:url&w=:width&q=:quality
redirectsOrigin: inline
5:27:18 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:27:18 PM: Failing build: Failed to build site
5:27:18 PM: Finished processing build request in 1m5.62s
So this has been driving us all insane. We have a website in Next.js 14.2.5 with Netlify CMS. The website works correctly in local and production environments: the client can log in to the CMS dashboard and add content, and the website rebuilds and redeploys. However, after ~8 commits, every build after that keeps failing, unless we manually “Clear cache and deploy site”.
Here’s the series of events where I tried to fix this:
- The error says the bundle is too big, must be because the website has a lot of big images. Let’s compress everything into webp as much as possible → Worked for a few deploys, then same issue.
- Maybe there are just way too many images in general, let’s put them all into cloud storage and remove all images from the repo → Same issue.
- Oh, if it works when I clear cache then maybe it’s a cache issue, the big images must still be in the git history. Let’s delete them from there → Same issue.
- Maybe Netlify is just refusing to clone the repository again to get a clean copy of the history, let’s create a whole new repo with only a single commit of all the files in the website, delete the previous project and create a new one with the new repo → Same issue.
I’m out of ideas now, we’re this close to calling in an exorcist.
I did find this guide with a few troubleshooting steps, but:
- We have not commited the node_modules folder.
- Do my dependencies have binary components? No idea, but if the deploy doesn’t work even when I make a new clean repo and project with no existing cache, then I don’t know how I could possibly fix this.
- The project only has a package.json and package-lock.json.
- We aren’t manually manipulating node_modules.
- We aren’t using yarn workspaces, or monorepos, just plain old npm.
- We are building the base directory.
Can anyone out there can give me an explanation for what’s going on? I don’t understand, it appears no one has ever had this issue before and I feel like I’m going crazy…