Hi there,
I’ve spent hours trying to find a fix for a nextjs app which is showing 404 on deployment. Have provided as much detail as I can below. Let me know if there’s anything else that you need.
Many thanks in advance!
1. Netlify site name
https://main--clever-heliotrope-12b645.netlify.app/
2. Repo
3. Debugging steps taken so far
3a. Added the following fly.toml file in root folder of project
[build]
command = "next build"
publish = ".next/"
[[redirects]]
from = "/_next/static/*"
to = "/static/:splat"
status = 301
force = true
3.b. Tried the following build settings:
-
Build settings #1
Build command: next build Publish directory: fontend/.next -
Build settings #2
Build command: next build Publish directory: frontend/.next/ -
Build settings #3
Build command: next build && next export Publish directory: out -
Build settings #4
Build command: next run build Publish directory: frontend/.next
3C. Tried the following posts too:
- next.js - Parsing error : Cannot find module 'next/babel' - Stack Overflow
- [Support Guide] I’ve deployed my site but I still see "Page not found”
- chat bot
4. Build logs
10:36:24 PM: Netlify Build
10:36:24 PM: ────────────────────────────────────────────────────────────────
10:36:24 PM:
10:36:24 PM: ❯ Version
10:36:24 PM: @netlify/build 29.31.1
10:36:24 PM:
10:36:24 PM: ❯ Flags
10:36:24 PM: baseRelDir: true
10:36:24 PM: buildId: 657b12d71b9e800008a68e78
10:36:24 PM: deployId: 657b12d71b9e800008a68e7a
10:36:24 PM:
10:36:24 PM: ❯ Current directory
10:36:24 PM: /opt/build/repo/frontend
10:36:24 PM:
10:36:24 PM: ❯ Config file
10:36:24 PM: /opt/build/repo/frontend/netlify.toml
10:36:24 PM:
10:36:24 PM: ❯ Context
10:36:24 PM: production
10:36:24 PM:
10:36:24 PM: build.command from netlify.toml
10:36:24 PM: ────────────────────────────────────────────────────────────────
10:36:24 PM:
10:36:24 PM: $ next build
10:36:24 PM: ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
10:36:24 PM: ▲ Next.js 14.0.1
10:36:24 PM: Creating an optimized production build ...
10:36:29 PM: ✓ Compiled successfully
10:36:29 PM: Linting and checking validity of types ...
10:36:29 PM: ⨯ ESLint: Failed to load config "next/babel" to extend from. Referenced from: /opt/build/repo/frontend/.eslintrc.json
10:36:29 PM: Collecting page data ...
10:36:30 PM: Generating static pages (0/6) ...
10:36:31 PM: Generating static pages (1/6)
10:36:31 PM: Generating static pages (2/6)
10:36:31 PM: Generating static pages (4/6)
10:36:31 PM: ✓ Generating static pages (6/6)
10:36:31 PM: Finalizing page optimization ...
10:36:31 PM: Collecting build traces ...
10:36:36 PM: Route (app) Size First Load JS
10:36:36 PM: ┌ ○ / 17.2 kB 115 kB
10:36:36 PM: ├ ○ /_not-found 875 B 86.2 kB
10:36:36 PM: ├ λ /contact-details/[id] 3.77 kB 102 kB
10:36:36 PM: ├ λ /edit-contact/[id] 5.71 kB 104 kB
10:36:36 PM: └ ○ /new-contact 5.21 kB 98 kB
10:36:36 PM: + First Load JS shared by all 85.4 kB
10:36:36 PM: ├ chunks/472-c6e2ea27ffdab861.js 30 kB
10:36:36 PM: ├ chunks/fd9d1056-ed9101b126eb98b1.js 53.3 kB
10:36:36 PM: ├ chunks/main-app-9bee3fe511df066a.js 230 B
10:36:36 PM: └ chunks/webpack-0d746ca5e5d1bf2b.js 1.84 kB
10:36:36 PM: ○ (Static) prerendered as static HTML
10:36:36 PM: λ (Dynamic) server-rendered on demand using Node.js
10:36:36 PM:
10:36:36 PM: (build.command completed in 11.8s)
10:36:36 PM:
10:36:36 PM: (Netlify Build completed in 12.4s)
10:36:37 PM: Section completed: building
10:36:40 PM: Finished processing build request in 31.517s
