Building Failed but there are no errors in logs Next

Hello

Can’t deploy my project, it is saying that building failed, but there are no errors in logs, only warnings, also other steps are done, as it show on screenshot
image

netlify dev runs everything fine, but I cant deploy my app
Site name https://cosmoswork.netlify.app

Here are the logs:

8:21:08 PM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal)
8:21:08 PM: buildbot version: 742cd4f739071a396139ba5020a96a927941b57d
8:21:08 PM: Fetching cached dependencies
8:21:08 PM: Starting to download cache of 226.0MB
8:21:10 PM: Finished downloading cache in 2.116s
8:21:10 PM: Starting to extract cache
8:21:12 PM: Finished extracting cache in 2.24s
8:21:12 PM: Finished fetching cache in 4.417s
8:21:12 PM: Starting to prepare the repo for build
8:21:13 PM: Preparing Git Reference refs/heads/master
8:21:14 PM: Starting to install dependencies
8:21:14 PM: Python version set to 3.8
8:21:15 PM: Attempting Ruby version 2.7.2, read from environment
8:21:15 PM: Using Ruby version 2.7.2
8:21:16 PM: Started restoring cached go cache
8:21:16 PM: Finished restoring cached go cache
8:21:18 PM: go version go1.19.13 linux/amd64
8:21:18 PM: Using PHP version 8.0
8:21:19 PM: Started restoring cached Node.js version
8:21:20 PM: Finished restoring cached Node.js version
8:21:20 PM: v18.19.1 is already installed.
8:21:20 PM: Now using node v18.19.1 (npm v10.2.4)
8:21:20 PM: Enabling Node.js Corepack
8:21:20 PM: Started restoring cached build plugins
8:21:20 PM: Finished restoring cached build plugins
8:21:20 PM: Started restoring cached corepack dependencies
8:21:20 PM: Finished restoring cached corepack dependencies
8:21:20 PM: No npm workspaces detected
8:21:20 PM: Started restoring cached node modules
8:21:20 PM: Finished restoring cached node modules
8:21:21 PM: Installing npm packages using npm version 10.2.4
8:21:25 PM: added 162 packages, and audited 625 packages in 5s
8:21:25 PM: 242 packages are looking for funding
8:21:25 PM: run npm fund for details
8:21:25 PM: found 0 vulnerabilities
8:21:25 PM: npm packages installed
8:21:26 PM: Successfully installed dependencies
8:21:26 PM: Starting build script
8:21:27 PM: Detected 1 framework(s)
8:21:27 PM: β€œnext” at version β€œ14.1.0”
8:21:27 PM: Section completed: initializing
8:21:28 PM: ​
8:21:28 PM: Netlify Build
8:21:28 PM: ────────────────────────────────────────────────────────────────
8:21:28 PM: ​
8:21:28 PM: ❯ Version
8:21:28 PM: @netlify/build 29.36.0
8:21:28 PM: ​
8:21:28 PM: ❯ Flags
8:21:28 PM: baseRelDir: true
8:21:28 PM: buildId: 65dd1cd7c7cfc500083161ad
8:21:28 PM: deployId: 65dd1cd7c7cfc500083161af
8:21:28 PM: ​
8:21:28 PM: ❯ Current directory
8:21:28 PM: /opt/build/repo
8:21:28 PM: ​
8:21:28 PM: ❯ Config file
8:21:28 PM: No config file was defined: using default values.
8:21:28 PM: ​
8:21:28 PM: ❯ Context
8:21:28 PM: production
8:21:28 PM: ​
8:21:28 PM: ❯ Using Next.js Runtime - v4.41.3
8:21:29 PM: ​
8:21:29 PM: @netlify/plugin-nextjs (onPreBuild event)
8:21:29 PM: ────────────────────────────────────────────────────────────────
8:21:29 PM: ​
8:21:29 PM: Next.js cache restored.
8:21:29 PM: ​
8:21:29 PM: (@netlify/plugin-nextjs onPreBuild completed in 121ms)
8:21:29 PM: ​
8:21:29 PM: Build command from Netlify app
8:21:29 PM: ────────────────────────────────────────────────────────────────
8:21:29 PM: ​
8:21:29 PM: $ next build
8:21:30 PM: β–² Next.js 14.1.0
8:21:30 PM: Creating an optimized production build …
8:21:36 PM: βœ“ Compiled successfully
8:21:36 PM: Linting and checking validity of types …
8:21:37 PM: ./src/components/hero/Hero.tsx
8:21:37 PM: 61:6 Warning: React Hook useEffect has a missing dependency: β€œdispatch”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
8:21:37 PM: ./src/components/pagination/Pagination.tsx
8:21:37 PM: 50:6 Warning: React Hook useEffect has a missing dependency: β€œdispatch”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
8:21:37 PM: ./src/components/vacancies/Vacancies.tsx
8:21:37 PM: 30:6 Warning: React Hook useEffect has a missing dependency: β€œdispatch”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
8:21:37 PM: 66:6 Warning: React Hook useEffect has a missing dependency: β€œdispatch”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
8:21:37 PM: 70:6 Warning: React Hook useEffect has a missing dependency: β€œfiltering”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
8:21:37 PM: ./src/utils/usePagination.ts
8:21:37 PM: 140:6 Warning: React Hook useMemo has missing dependencies: β€œcountPagesWidth”, β€œelements”, and β€œisSmall”. Either include them or remove the dependency array. react-hooks/exhaustive-deps
8:21:37 PM: info - Need to disable some ESLint rules? Learn more here: Configuring: ESLint | Next.js
8:21:38 PM: Collecting page data …
8:21:39 PM: Generating static pages (0/7) …
8:21:39 PM: Generating static pages (1/7)
8:21:39 PM: Generating static pages (3/7)
8:21:39 PM: Generating static pages (5/7)
8:21:40 PM: βœ“ Generating static pages (7/7)
8:21:40 PM: Finalizing page optimization …
8:21:40 PM: Collecting build traces …
8:21:44 PM: Route (app) Size First Load JS
8:21:44 PM: β”Œ Ξ» / 6.21 kB 113 kB
8:21:44 PM: β”œ β—‹ /_not-found 882 B 85.2 kB
8:21:44 PM: β”œ β—‹ /about 398 B 95.8 kB
8:21:44 PM: β”œ β—‹ /create 9.79 kB 94.1 kB
8:21:44 PM: β”œ β—‹ /icon.ico 0 B 0 B
8:21:44 PM: β”” Ξ» /job/[jobId] 91.6 kB 187 kB
8:21:44 PM: + First Load JS shared by all 84.3 kB
8:21:44 PM: β”œ chunks/69-3049e10feafd5c33.js 28.9 kB
8:21:44 PM: β”œ chunks/fd9d1056-9e625e8be9cf6216.js 53.4 kB
8:21:44 PM: β”” other shared chunks (total) 2.05 kB
8:21:44 PM: β—‹ (Static) prerendered as static content
8:21:44 PM: Ξ» (Dynamic) server-rendered on demand using Node.js
8:21:45 PM: ​
8:21:45 PM: (build.command completed in 15s)
8:21:45 PM: ​
8:21:45 PM: @netlify/plugin-nextjs (onBuild event)
8:21:45 PM: ────────────────────────────────────────────────────────────────
8:21:45 PM: ​
8:21:45 PM: Moving static page files to serve from CDN…
8:21:45 PM: Moved 8 files to CDN
8:21:45 PM: Using Netlify Edge Functions for image format detection. Set env var β€œNEXT_DISABLE_EDGE_IMAGES=true” to disable.
8:21:45 PM: :sparkles: Deploying middleware and functions to Netlify Edge Functions :sparkles:
8:21:45 PM: ​
8:21:45 PM: (@netlify/plugin-nextjs onBuild completed in 164ms)
8:21:45 PM: ​
8:21:45 PM: Functions bundling
8:21:45 PM: ────────────────────────────────────────────────────────────────
8:21:45 PM: ​
8:21:45 PM: Packaging Functions from .netlify/functions-internal directory:
8:21:45 PM: - ___netlify-handler/___netlify-handler.js
8:21:45 PM: - ___netlify-odb-handler/___netlify-odb-handler.js
8:21:45 PM: - _ipx/_ipx.js
8:21:45 PM: ​
8:21:56 PM: ​
8:21:56 PM: (Functions bundling completed in 11.2s)
8:21:56 PM: ​
8:21:56 PM: Edge Functions bundling
8:21:56 PM: ────────────────────────────────────────────────────────────────
8:21:56 PM: ​
8:21:56 PM: Packaging Edge Functions from .netlify/edge-functions directory:
8:21:56 PM: - ipx
8:21:56 PM: - rsc-data
8:21:56 PM: ​
8:21:56 PM: (Edge Functions bundling completed in 375ms)
8:21:56 PM: ​
8:21:56 PM: @netlify/plugin-nextjs (onPostBuild event)
8:21:56 PM: ────────────────────────────────────────────────────────────────
8:21:56 PM: ​
8:21:56 PM: Next.js cache saved.
8:21:57 PM: ​
8:21:57 PM: (@netlify/plugin-nextjs onPostBuild completed in 162ms)
8:21:57 PM: ​
8:21:57 PM: Deploy site
8:21:57 PM: ────────────────────────────────────────────────────────────────
8:21:57 PM: ​
8:21:57 PM: Starting to deploy site from β€œ.next”
8:21:57 PM: Calculating files to upload
8:21:57 PM: 10 new files to upload
8:21:57 PM: 2 new functions to upload
8:22:03 PM: Processing form - postJob
8:22:03 PM: Detected form fields:

  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    8:22:03 PM: Starting post processing
    8:22:03 PM: Post processing - Forms
    8:22:03 PM: Starting post processing
    8:22:03 PM: Post processing - Forms
    8:22:03 PM: Processing form - postJob
    8:22:03 PM: Detected form fields:
  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    8:22:03 PM: Starting post processing
    8:22:03 PM: Section completed: deploying
    8:22:03 PM: Site deploy was successfully initiated
    8:22:03 PM: ​
    8:22:03 PM: (Deploy site completed in 6.6s)
    8:22:03 PM: ​
    8:22:03 PM: Netlify Build Complete
    8:22:03 PM: ────────────────────────────────────────────────────────────────
    8:22:03 PM: ​
    8:22:03 PM: (Netlify Build completed in 35s)
    8:22:04 PM: Post processing - Forms
    8:22:04 PM: Starting post processing
    8:22:04 PM: Processing form - postJob
    8:22:04 PM: Detected form fields:
  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    8:22:04 PM: Processing form - postJob
    8:22:04 PM: Detected form fields:
  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    8:22:04 PM: Post processing - Forms
    8:22:04 PM: Processing form - postJob
    8:22:04 PM: Detected form fields:
  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    8:22:04 PM: Starting post processing
    8:22:04 PM: Post processing - Forms
    8:22:04 PM: Caching artifacts
    8:22:04 PM: Started saving node modules
    8:22:04 PM: Finished saving node modules
    8:22:04 PM: Started saving build plugins
    8:22:04 PM: Execution cancelled
    8:22:04 PM: Failing build: Failed to build site
    8:22:04 PM: Finished processing build request in 55.975s

tried to use netlify.toml and tried to delete it, everything is always the same, so, I will be glad for any help, thanks

@pozdnyakoks Try changing your build command to CI= next build

By default CI is true and when it is true warnings are treated as errors.

Thanks! Unfortunatly this didn’t help

Does it build locally @pozdnyakoks?

Can you provide the full build log from your most recent failed build?

yes, npm run build runs without mistakes and everything is good locally, also it runs with npm run dev and netlify dev, there are no errors on console

Sure, I guess nothing has changed

9:54:28 PM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal)
9:54:28 PM: buildbot version: 742cd4f739071a396139ba5020a96a927941b57d
9:54:28 PM: Fetching cached dependencies
9:54:28 PM: Starting to download cache of 226.0MB
9:54:30 PM: Finished downloading cache in 2.24s
9:54:30 PM: Starting to extract cache
9:54:32 PM: Finished extracting cache in 2.238s
9:54:32 PM: Finished fetching cache in 4.535s
9:54:32 PM: Starting to prepare the repo for build
9:54:33 PM: Preparing Git Reference refs/heads/master
9:54:34 PM: Starting to install dependencies
9:54:34 PM: Python version set to 3.8
9:54:35 PM: Attempting Ruby version 2.7.2, read from environment
9:54:35 PM: Using Ruby version 2.7.2
9:54:36 PM: Started restoring cached go cache
9:54:36 PM: Finished restoring cached go cache
9:54:37 PM: go version go1.19.13 linux/amd64
9:54:37 PM: Using PHP version 8.0
9:54:38 PM: Started restoring cached Node.js version
9:54:39 PM: Finished restoring cached Node.js version
9:54:39 PM: v18.19.1 is already installed.
9:54:40 PM: Now using node v18.19.1 (npm v10.2.4)
9:54:40 PM: Enabling Node.js Corepack
9:54:40 PM: Started restoring cached build plugins
9:54:40 PM: Finished restoring cached build plugins
9:54:40 PM: Started restoring cached corepack dependencies
9:54:40 PM: Finished restoring cached corepack dependencies
9:54:40 PM: No npm workspaces detected
9:54:40 PM: Started restoring cached node modules
9:54:40 PM: Finished restoring cached node modules
9:54:40 PM: Installing npm packages using npm version 10.2.4
9:54:46 PM: added 162 packages, and audited 625 packages in 6s
9:54:46 PM: 242 packages are looking for funding
9:54:46 PM: run npm fund for details
9:54:46 PM: found 0 vulnerabilities
9:54:46 PM: npm packages installed
9:54:47 PM: Successfully installed dependencies
9:54:47 PM: Starting build script
9:54:47 PM: Detected 1 framework(s)
9:54:47 PM: β€œnext” at version β€œ14.1.0”
9:54:47 PM: Section completed: initializing
9:54:49 PM: ​
9:54:49 PM: Netlify Build
9:54:49 PM: ────────────────────────────────────────────────────────────────
9:54:49 PM: ​
9:54:49 PM: ❯ Version
9:54:49 PM: @netlify/build 29.36.0
9:54:49 PM: ​
9:54:49 PM: ❯ Flags
9:54:49 PM: baseRelDir: true
9:54:49 PM: buildId: 65dd32b760233559f988e4fc
9:54:49 PM: deployId: 65dd32b760233559f988e4fe
9:54:49 PM: ​
9:54:49 PM: ❯ Current directory
9:54:49 PM: /opt/build/repo
9:54:49 PM: ​
9:54:49 PM: ❯ Config file
9:54:49 PM: No config file was defined: using default values.
9:54:49 PM: ​
9:54:49 PM: ❯ Context
9:54:49 PM: production
9:54:49 PM: ​
9:54:49 PM: ❯ Using Next.js Runtime - v4.41.3
9:54:50 PM: ​
9:54:50 PM: @netlify/plugin-nextjs (onPreBuild event)
9:54:50 PM: ────────────────────────────────────────────────────────────────
9:54:50 PM: ​
9:54:50 PM: Next.js cache restored.
9:54:50 PM: ​
9:54:50 PM: (@netlify/plugin-nextjs onPreBuild completed in 120ms)
9:54:50 PM: ​
9:54:50 PM: Build command from Netlify app
9:54:50 PM: ────────────────────────────────────────────────────────────────
9:54:50 PM: ​
9:54:50 PM: $ CI= next build
9:54:51 PM: β–² Next.js 14.1.0
9:54:51 PM: Creating an optimized production build …
9:54:57 PM: βœ“ Compiled successfully
9:54:57 PM: Linting and checking validity of types …
9:54:58 PM: ./src/components/hero/Hero.tsx
9:54:58 PM: 61:6 Warning: React Hook useEffect has a missing dependency: β€œdispatch”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:54:58 PM: ./src/components/pagination/Pagination.tsx
9:54:58 PM: 50:6 Warning: React Hook useEffect has a missing dependency: β€œdispatch”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:54:58 PM: ./src/components/vacancies/Vacancies.tsx
9:54:58 PM: 30:6 Warning: React Hook useEffect has a missing dependency: β€œdispatch”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:54:58 PM: 66:6 Warning: React Hook useEffect has a missing dependency: β€œdispatch”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:54:58 PM: 70:6 Warning: React Hook useEffect has a missing dependency: β€œfiltering”. Either include it or remove the dependency array. react-hooks/exhaustive-deps
9:54:58 PM: ./src/utils/usePagination.ts
9:54:58 PM: 140:6 Warning: React Hook useMemo has missing dependencies: β€œcountPagesWidth”, β€œelements”, and β€œisSmall”. Either include them or remove the dependency array. react-hooks/exhaustive-deps
9:54:58 PM: info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
9:54:59 PM: Collecting page data …
9:55:00 PM: Generating static pages (0/7) …
9:55:00 PM: Generating static pages (1/7)
9:55:00 PM: Generating static pages (3/7)
9:55:00 PM: Generating static pages (5/7)
9:55:03 PM: βœ“ Generating static pages (7/7)
9:55:03 PM: Finalizing page optimization …
9:55:03 PM: Collecting build traces …
9:55:06 PM: Route (app) Size First Load JS
9:55:06 PM: β”Œ Ξ» / 6.21 kB 113 kB
9:55:06 PM: β”œ β—‹ /_not-found 882 B 85.2 kB
9:55:06 PM: β”œ β—‹ /about 398 B 95.8 kB
9:55:06 PM: β”œ β—‹ /create 9.79 kB 94.1 kB
9:55:06 PM: β”œ β—‹ /icon.ico 0 B 0 B
9:55:06 PM: β”” Ξ» /job/[jobId] 91.6 kB 187 kB
9:55:06 PM: + First Load JS shared by all 84.3 kB
9:55:06 PM: β”œ chunks/69-3049e10feafd5c33.js 28.9 kB
9:55:06 PM: β”œ chunks/fd9d1056-9e625e8be9cf6216.js 53.4 kB
9:55:06 PM: β”” other shared chunks (total) 2.05 kB
9:55:06 PM: β—‹ (Static) prerendered as static content
9:55:06 PM: Ξ» (Dynamic) server-rendered on demand using Node.js
9:55:06 PM: ​
9:55:06 PM: (build.command completed in 15.2s)
9:55:06 PM: ​
9:55:06 PM: @netlify/plugin-nextjs (onBuild event)
9:55:06 PM: ────────────────────────────────────────────────────────────────
9:55:06 PM: ​
9:55:06 PM: Moving static page files to serve from CDN…
9:55:06 PM: Moved 8 files to CDN
9:55:06 PM: Using Netlify Edge Functions for image format detection. Set env var β€œNEXT_DISABLE_EDGE_IMAGES=true” to disable.
9:55:06 PM: :sparkles: Deploying middleware and functions to Netlify Edge Functions :sparkles:
9:55:06 PM: ​
9:55:06 PM: (@netlify/plugin-nextjs onBuild completed in 161ms)
9:55:06 PM: ​
9:55:06 PM: Functions bundling
9:55:06 PM: ────────────────────────────────────────────────────────────────
9:55:06 PM: ​
9:55:06 PM: Packaging Functions from .netlify/functions-internal directory:
9:55:06 PM: - ___netlify-handler/___netlify-handler.js
9:55:06 PM: - ___netlify-odb-handler/___netlify-odb-handler.js
9:55:06 PM: - _ipx/_ipx.js
9:55:06 PM: ​
9:55:18 PM: ​
9:55:18 PM: (Functions bundling completed in 11.6s)
9:55:18 PM: ​
9:55:18 PM: Edge Functions bundling
9:55:18 PM: ────────────────────────────────────────────────────────────────
9:55:18 PM: ​
9:55:18 PM: Packaging Edge Functions from .netlify/edge-functions directory:
9:55:18 PM: - ipx
9:55:18 PM: - rsc-data
9:55:18 PM: ​
9:55:18 PM: (Edge Functions bundling completed in 360ms)
9:55:18 PM: ​
9:55:18 PM: @netlify/plugin-nextjs (onPostBuild event)
9:55:18 PM: ────────────────────────────────────────────────────────────────
9:55:18 PM: ​
9:55:18 PM: Next.js cache saved.
9:55:18 PM: ​
9:55:18 PM: (@netlify/plugin-nextjs onPostBuild completed in 166ms)
9:55:18 PM: ​
9:55:18 PM: Deploy site
9:55:18 PM: ────────────────────────────────────────────────────────────────
9:55:18 PM: ​
9:55:18 PM: Starting to deploy site from β€œ.next”
9:55:18 PM: Calculating files to upload
9:55:18 PM: 10 new files to upload
9:55:18 PM: 2 new functions to upload
9:55:25 PM: Section completed: deploying
9:55:25 PM: Site deploy was successfully initiated
9:55:25 PM: ​
9:55:25 PM: (Deploy site completed in 6.5s)
9:55:25 PM: ​
9:55:25 PM: Netlify Build Complete
9:55:25 PM: ────────────────────────────────────────────────────────────────
9:55:25 PM: ​
9:55:25 PM: (Netlify Build completed in 35.6s)
9:55:25 PM: Post processing - Forms
9:55:25 PM: Processing form - postJob
9:55:25 PM: Detected form fields:

  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    9:55:25 PM: Starting post processing
    9:55:25 PM: Processing form - postJob
    9:55:25 PM: Detected form fields:
  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    9:55:25 PM: Execution cancelled
    9:55:25 PM: Failing build: Failed to build site
    9:55:25 PM: Finished processing build request in 57.509s
    9:55:25 PM: Processing form - postJob
    9:55:25 PM: Detected form fields:
  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    9:55:25 PM: Post processing - Forms
    9:55:25 PM: Starting post processing
    9:55:25 PM: Starting post processing
    9:55:25 PM: Post processing - Forms
    9:55:25 PM: Starting post processing
    9:55:25 PM: Starting post processing
    9:55:25 PM: Post processing - Forms
    9:55:25 PM: Processing form - postJob
    9:55:25 PM: Detected form fields:
  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link
    9:55:25 PM: Post processing - Forms
    9:55:25 PM: Processing form - postJob
    9:55:25 PM: Detected form fields:
  • Company
  • Company Website
  • Email
  • Details
  • Location
  • Salary
  • Apply Link

Have you tried building with Netlify locally?

I only wanted to check one thing anyway, that you’d set the CI value.

You’d be surprised how frequently people say β€œI’ve done X” and then when you check, it turns out they haven’t.

Since Next is involved, I wouldn’t be surprised if it’s Next middleware related sillyness, so I’m going to step out of this one, best of luck getting it solved!

2 Likes

|'ve tried now, and there is an error, have no idea which, because it doesn’t show

I’m taking a leaf out of @nathanmartin’s book.

If he can’t help you, then I’ve got not hope.

1 Like

UPD app runs good if I upload project for the first time, but if I click β€œretry with latest branch commit” or β€œclear cache and retry with latest branch commit” the error would be the same as above, so even if I don’t change anythyng, the building faild error will appear

Found a problem, when I enable Form detection I got this building failed problem, when I turn it off, everything is okay, so I guess I have to find a way to work with form now

The problem is your form’s code. We don’t support any special characters in the HTML attributes. One of your attribute was: Your Company/Project's name. That ' is tripping things.

If you can remove all references of that character in your form, you can enable form detection again.

1 Like