Next JS page not found after succesfull deploy

Hey! I would like to go live with my Next JS site. It can deploy but it shows a Page Not Found when I go to the site. Who can help me?

Build settings
Runtime
Next.js

Base directory
Not set

Build command
npm run build

Publish directory
.next

Build status

Active

Netlify.toml
[build]
command = “npm run build && npm run export”
publish = “.next”
[[redirects]]
from = “/*”
to = “/index.html”
status = 200
[[plugins]]
package = “@netlify/plugin-nextjs”

Deploy log

Initializing
Complete
9:41:43 PM: build-image version: 20e1f1f500e4cbad9ea8a99bd40807bef3093551 (focal)
9:41:43 PM: buildbot version: 4ee76d98466e2dfc33516fcb7e63e2a20615fbc6
9:41:44 PM: Fetching cached dependencies
9:41:44 PM: Starting to download cache of 934.3MB
9:41:52 PM: Finished downloading cache in 8.23s
9:41:52 PM: Starting to extract cache
9:41:56 PM: Finished extracting cache in 4.691s
9:41:57 PM: Finished fetching cache in 13.029s
9:41:57 PM: Starting to prepare the repo for build
9:41:57 PM: Preparing Git Reference refs/heads/main
9:41:59 PM: Starting to install dependencies
9:41:59 PM: Python version set to 3.8
9:41:59 PM: Attempting Ruby version 2.7.2, read from environment
9:42:00 PM: Using Ruby version 2.7.2
9:42:00 PM: Started restoring cached go cache
9:42:00 PM: Finished restoring cached go cache
9:42:00 PM: go version go1.19.11 linux/amd64
9:42:01 PM: Using PHP version 8.0
9:42:01 PM: Started restoring cached Node.js version
9:42:02 PM: Finished restoring cached Node.js version
9:42:03 PM: v16.20.1 is already installed.
9:42:03 PM: Now using node v16.20.1 (npm v8.19.4)
9:42:03 PM: Enabling Node.js Corepack
9:42:03 PM: Started restoring cached build plugins
9:42:03 PM: Finished restoring cached build plugins
9:42:03 PM: Started restoring cached corepack dependencies
9:42:03 PM: Finished restoring cached corepack dependencies
9:42:03 PM: Started restoring cached yarn cache
9:42:05 PM: Finished restoring cached yarn cache
9:42:05 PM: No yarn workspaces detected
9:42:05 PM: Started restoring cached node modules
9:42:05 PM: Finished restoring cached node modules
9:42:05 PM: Installing npm packages using Yarn version 1.22.19
9:42:06 PM: yarn install v1.22.19
9:42:06 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
9:42:06 PM: [1/4] Resolving packages...
9:42:07 PM: [2/4] Fetching packages...
9:42:07 PM: [3/4] Linking dependencies...
9:42:07 PM: warning eslint-config-next > @typescript-eslint/parser > @typescript-eslint/typescript-estree > tsutils@3.21.0 has unmet peer dependency typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta.
9:42:08 PM: [4/4] Building fresh packages...
9:42:08 PM: success Saved lockfile.
9:42:08 PM: Done in 2.53s.
9:42:08 PM: npm packages installed using Yarn
9:42:09 PM: Install dependencies script success
9:42:09 PM: Starting build script
9:42:09 PM: Detected 1 framework(s)
9:42:09 PM: next at version 13.0.5
9:42:09 PM: Section completed: initializing
Building
Complete
9:42:11 PM: Netlify Build                                                 
9:42:11 PM: ────────────────────────────────────────────────────────────────
9:42:11 PM: ​
9:42:11 PM: ❯ Version
9:42:11 PM:   @netlify/build 29.17.4
9:42:11 PM: ​
9:42:11 PM: ❯ Flags
9:42:11 PM:   baseRelDir: true
9:42:11 PM:   buildId: 64c95fde744f720008496f13
9:42:11 PM:   deployId: 64c95fde744f720008496f15
9:42:11 PM: ​
9:42:11 PM: ❯ Current directory
9:42:11 PM:   /opt/build/repo
9:42:11 PM: ​
9:42:11 PM: ❯ Config file
9:42:11 PM:   No config file was defined: using default values.
9:42:11 PM: ​
9:42:11 PM: ❯ Context
9:42:11 PM:   production
9:42:11 PM: ​
9:42:11 PM: ❯ Using Next.js Runtime - v4.39.1
9:42:12 PM: ​
9:42:12 PM: @netlify/plugin-nextjs (onPreBuild event)                     
9:42:12 PM: ────────────────────────────────────────────────────────────────
9:42:12 PM: ​
9:42:12 PM: Next.js cache restored.
9:42:12 PM: Not running Next Runtime
9:42:12 PM: ​
9:42:12 PM: (@netlify/plugin-nextjs onPreBuild completed in 99ms)
9:42:12 PM: ​
9:42:12 PM: Build command from Netlify app                                
9:42:12 PM: ────────────────────────────────────────────────────────────────
9:42:12 PM: ​
9:42:12 PM: $ npm run build
9:42:13 PM: > build
9:42:13 PM: > next build
9:42:13 PM: info  - Linting and checking validity of types...
9:42:15 PM: info  - Creating an optimized production build...
9:42:16 PM: Browserslist: caniuse-lite is outdated. Please run:
9:42:16 PM:   npx browserslist@latest --update-db
9:42:16 PM:   Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
9:42:18 PM: Browserslist: caniuse-lite is outdated. Please run:
9:42:18 PM:   npx browserslist@latest --update-db
9:42:18 PM:   Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
9:42:19 PM: info  - Compiled successfully
9:42:19 PM: info  - Collecting page data...
9:42:20 PM: info  - Generating static pages (0/6)
9:42:20 PM: info  - Generating static pages (1/6)
9:42:20 PM: info  - Generating static pages (2/6)
9:42:20 PM: info  - Generating static pages (4/6)
9:42:20 PM: info  - Generating static pages (6/6)
9:42:21 PM: info  - Finalizing page optimization...
9:42:21 PM: Route (pages)                              Size     First Load JS
9:42:21 PM: ┌ ○ / (612 ms)                             3.51 kB         119 kB
9:42:21 PM: ├   /_app                                  0 B             115 kB
9:42:21 PM: ├ ○ /404                                   181 B           115 kB
9:42:21 PM: ├ ○ /about (593 ms)                        4.85 kB         120 kB
9:42:21 PM: ├ λ /api/hello                             0 B             115 kB
9:42:21 PM: ├ ○ /contact (607 ms)                      670 B           116 kB
9:42:21 PM: ├ ○ /projects (604 ms)                     2.81 kB         118 kB
9:42:21 PM: └ λ /projects/[id]                         1.83 kB         117 kB
9:42:21 PM: + First Load JS shared by all              121 kB
9:42:21 PM:   ├ chunks/framework-3b5a00d5d7e8d93b.js   45.4 kB
9:42:21 PM:   ├ chunks/main-90a34299418a0f2b.js        26.7 kB
9:42:21 PM:   ├ chunks/pages/_app-c033506571b85e04.js  42.4 kB
9:42:21 PM:   ├ chunks/webpack-8fa1640cc84ba8fe.js     750 B
9:42:21 PM:   └ css/fa859e5a009b5f5e.css               5.86 kB
9:42:21 PM: λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
9:42:21 PM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
9:42:21 PM: ​
9:42:21 PM: (build.command completed in 8.6s)
9:42:21 PM: ​
9:42:21 PM: @netlify/plugin-nextjs (onBuild event)                        
9:42:21 PM: ────────────────────────────────────────────────────────────────
9:42:21 PM: ​
9:42:21 PM: ​
9:42:21 PM: (@netlify/plugin-nextjs onBuild completed in 4ms)
9:42:21 PM: ​
9:42:21 PM: @netlify/plugin-nextjs (onPostBuild event)                    
9:42:21 PM: ────────────────────────────────────────────────────────────────
9:42:21 PM: ​
9:42:21 PM: Next.js cache saved.
9:42:21 PM: ​
9:42:21 PM: (@netlify/plugin-nextjs onPostBuild completed in 61ms)
9:42:21 PM: ​
9:42:22 PM: (Netlify Build completed in 10.7s)
9:42:24 PM: Section completed: building
9:42:33 PM: Finished processing build request in 50.02s
Deploying
Complete
9:42:21 PM: Deploy site                                                   
9:42:21 PM: ────────────────────────────────────────────────────────────────
9:42:21 PM: ​
9:42:21 PM: Starting to deploy site from '.next'
9:42:21 PM: Calculating files to upload
9:42:21 PM: 20 new files to upload
9:42:21 PM: 0 new functions to upload
9:42:21 PM: Section completed: deploying
9:42:21 PM: Site deploy was successfully initiated
9:42:21 PM: ​
9:42:21 PM: (Deploy site completed in 435ms)
Cleanup
Complete
9:42:22 PM: Netlify Build Complete                                        
9:42:22 PM: ────────────────────────────────────────────────────────────────
9:42:22 PM: ​
9:42:22 PM: Caching artifacts
9:42:22 PM: Started saving node modules
9:42:22 PM: Finished saving node modules
9:42:22 PM: Started saving build plugins
9:42:22 PM: Finished saving build plugins
9:42:22 PM: Started saving corepack cache
9:42:22 PM: Finished saving corepack cache
9:42:22 PM: Started saving yarn cache
9:42:24 PM: Finished saving yarn cache
9:42:24 PM: Started saving pip cache
9:42:24 PM: Finished saving pip cache
9:42:24 PM: Started saving emacs cask dependencies
9:42:24 PM: Finished saving emacs cask dependencies
9:42:24 PM: Started saving maven dependencies
9:42:24 PM: Finished saving maven dependencies
9:42:24 PM: Started saving boot dependencies
9:42:24 PM: Finished saving boot dependencies
9:42:24 PM: Started saving rust rustup cache
9:42:24 PM: Finished saving rust rustup cache
9:42:24 PM: Started saving go dependencies
9:42:24 PM: Finished saving go dependencies
9:42:24 PM: Build script success
9:42:27 PM: Uploading Cache of size 934.2MB
9:42:33 PM: Section completed: cleanup
Post-processing
Complete
9:42:21 PM: Starting post processing
9:42:22 PM: Skipping HTML post processing
9:42:22 PM: Post processing - header rules
9:42:22 PM: Post processing - redirect rules
9:42:22 PM: Post processing done
9:42:22 PM: Section completed: postprocessing
9:42:23 PM: Site is live ✨

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!

I dont see any solution in here… My site is Page Not Found (main–incredible-tiramisu-a2021e.netlify.app) @SamO

Hi @sanderbrijer,

This appears to be resolved.