404 not found but i'm getting successful build for my Nextjs app

PLEASE help us help you by writing a good post!

https://dainty-fudge-566750.netlify.app

10:43:40 PM: Build ready to start
10:43:42 PM: build-image version: b99b04bce77f7c739cbd5eebb242ff3ddb54ba7b (focal)
10:43:42 PM: buildbot version: b99b04bce77f7c739cbd5eebb242ff3ddb54ba7b
10:43:42 PM: Fetching cached dependencies
10:43:42 PM: Starting to download cache of 1.3GB
10:43:53 PM: Finished downloading cache in 10.626s
10:43:53 PM: Starting to extract cache
10:44:04 PM: Finished extracting cache in 10.589s
10:44:04 PM: Finished fetching cache in 21.388s
10:44:04 PM: Starting to prepare the repo for build
10:44:04 PM: Preparing Git Reference refs/heads/main
10:44:04 PM: Parsing package.json dependencies
10:44:06 PM: Starting to install dependencies
10:44:06 PM: Started restoring cached go cache
10:44:06 PM: Finished restoring cached go cache
10:44:06 PM: Installing Go version 1.19.5 (requested 1.19.5)
10:44:11 PM: go version go1.19.5 linux/amd64
10:44:11 PM: Using PHP version 8.0
10:44:12 PM: Started restoring cached Node.js version
10:44:13 PM: Finished restoring cached Node.js version
10:44:13 PM: v16.19.1 is already installed.
10:44:13 PM: Now using node v16.19.1 (npm v8.19.3)
10:44:13 PM: Enabling Node.js Corepack
10:44:13 PM: Started restoring cached build plugins
10:44:13 PM: Finished restoring cached build plugins
10:44:13 PM: Started restoring cached corepack dependencies
10:44:13 PM: Finished restoring cached corepack dependencies
10:44:13 PM: Started restoring cached yarn cache
10:44:20 PM: Finished restoring cached yarn cache
10:44:21 PM: No yarn workspaces detected
10:44:21 PM: Started restoring cached node modules
10:44:21 PM: Finished restoring cached node modules
10:44:21 PM: Installing npm packages using Yarn version 1.22.19
10:44:21 PM: yarn install v1.22.19
10:44:21 PM: [1/4] Resolving packages…
10:44:21 PM: success Already up-to-date.
10:44:21 PM: Done in 0.29s.
10:44:21 PM: npm packages installed using Yarn
10:44:22 PM: Attempting Ruby version 2.7.2, read from environment
10:44:23 PM: Using Ruby version 2.7.2
10:44:24 PM: Python version set to 3.8
10:44:24 PM: Install dependencies script success
10:44:24 PM: Starting build script
10:44:24 PM: Using stage install dependencies
10:44:25 PM: Detected 1 framework(s)
10:44:25 PM: “next” at version “13.2.3”
10:44:25 PM: Section completed: initializing
10:44:27 PM: ​
10:44:27 PM: Netlify Build
10:44:27 PM: ────────────────────────────────────────────────────────────────
10:44:27 PM: ​
10:44:27 PM: ❯ Version
10:44:27 PM: @netlify/build 29.8.0
10:44:27 PM: ​
10:44:27 PM: ❯ Flags
10:44:27 PM: baseRelDir: true
10:44:27 PM: buildId: 64235f8c74f843000880f49c
10:44:27 PM: deployId: 64235f8c74f843000880f49e
10:44:27 PM: ​
10:44:27 PM: ❯ Current directory
10:44:27 PM: /opt/build/repo
10:44:27 PM: ​
10:44:27 PM: ❯ Config file
10:44:27 PM: /opt/build/repo/netlify.toml
10:44:27 PM: ​
10:44:27 PM: ❯ Context
10:44:27 PM: production
10:44:27 PM: ​
10:44:27 PM: ❯ Using Next.js Runtime - v4.33.0
10:44:28 PM: ​
10:44:28 PM: 1. @netlify/plugin-nextjs (onPreBuild event)
10:44:28 PM: ────────────────────────────────────────────────────────────────
10:44:28 PM: ​
10:44:29 PM: Next.js cache restored.
10:44:29 PM: Netlify configuration property “build.environment.NEXT_PRIVATE_TARGET” value changed.
10:44:29 PM: ​
10:44:29 PM: (@netlify/plugin-nextjs onPreBuild completed in 119ms)
10:44:29 PM: ​
10:44:29 PM: 2. build.command from netlify.toml
10:44:29 PM: ────────────────────────────────────────────────────────────────
10:44:29 PM: ​
10:44:29 PM: $ yarn build
10:44:29 PM: yarn run v1.22.19
10:44:29 PM: $ next build
10:44:29 PM: info - Linting and checking validity of types…
10:44:32 PM: info - Creating an optimized production build…
10:44:38 PM: info - Compiled successfully
10:44:38 PM: info - Collecting page data…
10:44:40 PM: info - Generating static pages (0/2)
10:44:40 PM: info - Generating static pages (2/2)
10:44:41 PM: info - Finalizing page optimization…
10:44:41 PM: Route (pages) Size First Load JS
10:44:41 PM: ┌ /_app 0 B 94.9 kB
10:44:41 PM: ├ λ /[productId] 1.03 kB 142 kB
10:44:41 PM: ├ λ /[productId]/[productItems] 1.12 kB 142 kB
10:44:41 PM: ├ λ /[productId]/[productItems]/[productItem] 1.34 kB 142 kB
10:44:41 PM: └ ○ /404 182 B 95.1 kB
10:44:41 PM: + First Load JS shared by all 95.2 kB
10:44:41 PM: ├ chunks/framework-2c79e2a64abdb08b.js 45.2 kB
10:44:41 PM: ├ chunks/main-0c597b21730512df.js 27 kB
10:44:41 PM: ├ chunks/pages/_app-6967995e16fc0380.js 21.7 kB
10:44:41 PM: ├ chunks/webpack-c4acd79e87956a0e.js 943 B
10:44:41 PM: └ css/1ba924be988d127a.css 372 B
10:44:41 PM: λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
10:44:41 PM: ○ (Static) automatically rendered as static HTML (uses no initial props)
10:44:41 PM: Done in 12.14s.
10:44:41 PM: ​
10:44:41 PM: (build.command completed in 12.2s)
10:44:41 PM: ​
10:44:41 PM: 3. @netlify/plugin-nextjs (onBuild event)
10:44:41 PM: ────────────────────────────────────────────────────────────────
10:44:41 PM: ​
10:44:41 PM: Patching /opt/build/repo/node_modules/next/dist/server/base-server.js
10:44:41 PM: Done
10:44:41 PM: Patching /opt/build/repo/node_modules/next/dist/server/next-server.js
10:44:41 PM: Done
10:44:41 PM: Moving static page files to serve from CDN…
10:44:41 PM: Moved 0 files
10:44:41 PM: You are not using Netlify Edge Functions for image format detection. Set env var “NEXT_FORCE_EDGE_IMAGES=true” to enable.
10:44:41 PM: Netlify configuration property “redirects” value changed to [
10:44:41 PM: { from: ‘/next/static/', to: ‘/static/:splat’, status: 200 },
10:44:41 PM: {
10:44:41 PM: from: '/_next/image
’,
10:44:41 PM: query: { url: ‘:url’, w: ‘:width’, q: ‘:quality’ },
10:44:41 PM: to: '/ipx/w:width,q
:quality/:url’,
10:44:41 PM: status: 301
10:44:41 PM: },
10:44:41 PM: { from: ‘/_ipx/', to: ‘/.netlify/builders/_ipx’, status: 200 },
10:44:41 PM: { from: '/cache/
’, to: ‘/404.html’, status: 404, force: true },
10:44:41 PM: { from: ‘/server/', to: ‘/404.html’, status: 404, force: true },
10:44:41 PM: { from: '/serverless/
’, to: ‘/404.html’, status: 404, force: true },
10:44:41 PM: { from: ‘/trace’, to: ‘/404.html’, status: 404, force: true },
10:44:41 PM: { from: ‘/traces’, to: ‘/404.html’, status: 404, force: true },
10:44:41 PM: {
10:44:41 PM: from: ‘/routes-manifest.json’,
10:44:41 PM: to: ‘/404.html’,
10:44:41 PM: status: 404,
10:44:41 PM: force: true
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/build-manifest.json’,
10:44:41 PM: to: ‘/404.html’,
10:44:41 PM: status: 404,
10:44:41 PM: force: true
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/prerender-manifest.json’,
10:44:41 PM: to: ‘/404.html’,
10:44:41 PM: status: 404,
10:44:41 PM: force: true
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/react-loadable-manifest.json’,
10:44:41 PM: to: ‘/404.html’,
10:44:41 PM: status: 404,
10:44:41 PM: force: true
10:44:41 PM: },
10:44:41 PM: { from: ‘/BUILD_ID’, to: ‘/404.html’, status: 404, force: true },
10:44:41 PM: {
10:44:41 PM: from: ‘/api/',
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/favicon.ico’,
10:44:41 PM: to: ‘/favicon.ico’,
10:44:41 PM: conditions: { Cookie: [Array] },
10:44:41 PM: status: 200
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/next.svg’,
10:44:41 PM: to: ‘/next.svg’,
10:44:41 PM: conditions: { Cookie: [Array] },
10:44:41 PM: status: 200
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/thirteen.svg’,
10:44:41 PM: to: ‘/thirteen.svg’,
10:44:41 PM: conditions: { Cookie: [Array] },
10:44:41 PM: status: 200
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/vercel.svg’,
10:44:41 PM: to: ‘/vercel.svg’,
10:44:41 PM: conditions: { Cookie: [Array] },
10:44:41 PM: status: 200
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: '/
’,
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200,
10:44:41 PM: conditions: { Cookie: [Array] },
10:44:41 PM: force: true
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/_next/data/_gAQCK14rTvHmVA7OEJ_N/:productId.json’,
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200,
10:44:41 PM: force: false
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/:productId’,
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200,
10:44:41 PM: force: false
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/_next/data/_gAQCK14rTvHmVA7OEJ_N/:productId/:productItems.json’,
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200,
10:44:41 PM: force: false
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/:productId/:productItems’,
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200,
10:44:41 PM: force: false
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/_next/data/_gAQCK14rTvHmVA7OEJ_N/:productId/:productItems/:productItem.json’,
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200,
10:44:41 PM: force: false
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/:productId/:productItems/:productItem’,
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200,
10:44:41 PM: force: false
10:44:41 PM: },
10:44:41 PM: {
10:44:41 PM: from: ‘/*’,
10:44:41 PM: to: ‘/.netlify/functions/___netlify-handler’,
10:44:41 PM: status: 200
10:44:41 PM: }
10:44:41 PM: ].
10:44:41 PM: ​
10:44:41 PM: (@netlify/plugin-nextjs onBuild completed in 108ms)
10:44:41 PM: ​
10:44:41 PM: 4. Functions bundling
10:44:41 PM: ────────────────────────────────────────────────────────────────
10:44:41 PM: ​
10:44:41 PM: Packaging Functions from .netlify/functions-internal directory:
10:44:41 PM: - ___netlify-handler/___netlify-handler.js
10:44:41 PM: - ___netlify-odb-handler/___netlify-odb-handler.js
10:44:41 PM: - _ipx/_ipx.js
10:44:41 PM: ​
10:45:13 PM: ​
10:45:13 PM: (Functions bundling completed in 32.1s)
10:45:13 PM: ​
10:45:13 PM: 5. Edge Functions bundling
10:45:13 PM: ────────────────────────────────────────────────────────────────
10:45:13 PM: ​
10:45:14 PM: ​
10:45:14 PM: (Edge Functions bundling completed in 352ms)
10:45:14 PM: ​
10:45:14 PM: 6. @netlify/plugin-nextjs (onPostBuild event)
10:45:14 PM: ────────────────────────────────────────────────────────────────
10:45:14 PM: ​
10:45:14 PM: Next.js cache saved.
10:45:14 PM: ​
10:45:14 PM: (@netlify/plugin-nextjs onPostBuild completed in 108ms)
10:45:14 PM: ​
10:45:14 PM: 7. Deploy site
10:45:14 PM: ────────────────────────────────────────────────────────────────
10:45:14 PM: ​
10:45:14 PM: Starting to deploy site from ‘.next’
10:45:14 PM: Calculating files to upload
10:45:14 PM: 20 new files to upload
10:45:14 PM: 2 new functions to upload
10:45:21 PM: Section completed: deploying
10:45:21 PM: Site deploy was successfully initiated
10:45:21 PM: ​
10:45:21 PM: (Deploy site completed in 7.8s)
10:45:21 PM: Starting post processing
10:45:22 PM: ​
10:45:22 PM: Netlify Build Complete
10:45:22 PM: ────────────────────────────────────────────────────────────────
10:45:22 PM: ​
10:45:22 PM: Post processing - HTML
10:45:22 PM: (Netlify Build completed in 54.8s)
10:45:22 PM: Caching artifacts
10:45:22 PM: Post processing - header rules
10:45:22 PM: Started saving node modules
10:45:22 PM: Finished saving node modules
10:45:22 PM: Started saving build plugins
10:45:22 PM: Post processing - redirect rules
10:45:22 PM: Finished saving build plugins
10:45:22 PM: Started saving corepack cache
10:45:22 PM: Finished saving corepack cache
10:45:22 PM: Started saving yarn cache
10:45:22 PM: Post processing done
10:45:22 PM: Section completed: postprocessing
10:45:23 PM: Site is live :sparkles:
10:45:28 PM: Finished saving yarn cache
10:45:28 PM: Started saving pip cache
10:45:28 PM: Finished saving pip cache
10:45:28 PM: Started saving emacs cask dependencies
10:45:28 PM: Finished saving emacs cask dependencies
10:45:28 PM: Started saving maven dependencies
10:45:28 PM: Finished saving maven dependencies
10:45:28 PM: Started saving boot dependencies
10:45:28 PM: Finished saving boot dependencies
10:45:28 PM: Started saving rust rustup cache
10:45:28 PM: Finished saving rust rustup cache
10:45:28 PM: Started saving go dependencies
10:45:28 PM: Finished saving go dependencies
10:45:29 PM: Build script success
10:45:29 PM: Section completed: building
10:45:51 PM: Uploading Cache of size 1.3GB
10:46:02 PM: Section completed: cleanup
10:46:02 PM: Finished processing build request in 2m19.434s

Hi there,

Did you see this guide yet? This is the best place to start for “Page Not Found” issues.

If you are still seeing issues after following the troubleshooting steps in there, please check out this Support Guide as well. It outlines all of our build and deploy resources and will get you on the right track :slight_smile:

If none of the above resources help, please write back with your site name and what steps you have tried and we can look into this further!

Yes but that applies to react apps, this is a Nextjs app. I’ve also tried solutions seen on the forum.

What does your console tell you? Also can you share your build-instance?