Site Home Page Is 404 after nextjs deploy from sub directory

I have this repo: https://github.com/alanwsmith/css-playground.alanwsmith.com

which I’m deploying to here: https://css-playground.alanwsmith.com/

But it’s only showing a 404.

The site is Next.js and is housed in a site subdirectory in the repo.

I’ve tried several different setting in both the netlify.toml file and in the web GUI config settings and can’t figure out what’s up.

I’ve also tried deploying with the Clear Clash and Deploy trigger.

I’ve looked at the long post on 404 pages, but haven’t seen anything there that got me fixed.

My current netlify.toml file is:

[build]
  base = "/site/"
  publish = ".next"
  command = "npm run build"

The full deploy log is:

9:01:56 PM: Build ready to start
9:01:58 PM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal)
9:01:58 PM: build-image tag: v4.5.3
9:01:58 PM: buildbot version: 618a04140a44a0a80470bd94a1ccfe6eb588786d
9:01:59 PM: Fetching cached dependencies
9:01:59 PM: Starting to download cache of 135.9MB
9:01:59 PM: Finished downloading cache in 721.588705ms
9:01:59 PM: Starting to extract cache
9:02:04 PM: Finished extracting cache in 4.906034802s
9:02:04 PM: Finished fetching cache in 5.65426486s
9:02:04 PM: Starting to prepare the repo for build
9:02:04 PM: Preparing Git Reference refs/heads/main
9:02:05 PM: Parsing package.json dependencies
9:02:05 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: 'site' versus '' in the Netlify UI
9:02:05 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'site/.next' versus '' in the Netlify UI
9:02:05 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npm run build' versus '' in the Netlify UI
9:02:06 PM: Starting build script
9:02:06 PM: Installing dependencies
9:02:06 PM: Python version set to 2.7
9:02:06 PM: Started restoring cached node version
9:02:08 PM: Finished restoring cached node version
9:02:09 PM: v16.13.2 is already installed.
9:02:09 PM: Now using node v16.13.2 (npm v8.1.2)
9:02:09 PM: Started restoring cached build plugins
9:02:09 PM: Finished restoring cached build plugins
9:02:10 PM: Attempting ruby version 2.7.2, read from environment
9:02:11 PM: Using ruby version 2.7.2
9:02:12 PM: Using PHP version 8.0
9:02:12 PM: Started restoring cached node modules
9:02:12 PM: Finished restoring cached node modules
9:02:12 PM: Started restoring cached go cache
9:02:12 PM: Finished restoring cached go cache
9:02:12 PM: go version go1.16.5 linux/amd64
9:02:12 PM: go version go1.16.5 linux/amd64
9:02:12 PM: Installing missing commands
9:02:12 PM: Verify run directory
9:02:14 PM: ​
9:02:14 PM: ────────────────────────────────────────────────────────────────
9:02:14 PM:   Netlify Build                                                 
9:02:14 PM: ────────────────────────────────────────────────────────────────
9:02:14 PM: ​
9:02:14 PM: ❯ Version
9:02:14 PM:   @netlify/build 26.2.2
9:02:14 PM: ​
9:02:14 PM: ❯ Flags
9:02:14 PM:   baseRelDir: true
9:02:14 PM:   buildId: 61fb37941a6518000822b687
9:02:14 PM:   deployId: 61fb37941a6518000822b689
9:02:14 PM: ​
9:02:14 PM: ❯ Current directory
9:02:14 PM:   /opt/build/repo/site
9:02:14 PM: ​
9:02:14 PM: ❯ Config file
9:02:14 PM:   /opt/build/repo/netlify.toml
9:02:14 PM: ​
9:02:14 PM: ❯ Context
9:02:14 PM:   production
9:02:14 PM: ​
9:02:14 PM: ────────────────────────────────────────────────────────────────
9:02:14 PM:   1. build.command from netlify.toml                            
9:02:14 PM: ────────────────────────────────────────────────────────────────
9:02:14 PM: ​
9:02:14 PM: $ npm run build
9:02:15 PM: > build
9:02:15 PM: > next build
9:02:16 PM: warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
9:02:16 PM: info  - Checking validity of types...
9:02:19 PM: info  - Creating an optimized production build...
9:02:30 PM: info  - Compiled successfully
9:02:30 PM: info  - Collecting page data...
9:02:33 PM: info  - Generating static pages (0/4)
9:02:33 PM: info  - Generating static pages (1/4)
9:02:33 PM: info  - Generating static pages (2/4)
9:02:33 PM: info  - Generating static pages (3/4)
9:02:33 PM: info  - Generating static pages (4/4)
9:02:33 PM: info  - Finalizing page optimization...
9:02:33 PM: Page                                                    Size     First Load JS
9:02:33 PM: ┌ ○ /                                                   2.7 kB         72.9 kB
9:02:33 PM: ├   /_app                                               0 B            70.2 kB
9:02:33 PM: ├ ○ /404                                                194 B          70.4 kB
9:02:33 PM: └ ○ /sandbox/keep-address-bar-visible-in-safari-on-ios  5.19 kB        75.4 kB
9:02:33 PM:     └ css/32bbaad456f56167.css                          155 B
9:02:33 PM: + First Load JS shared by all                           70.2 kB
9:02:33 PM:   ├ chunks/framework-91d7f78b5b4003c8.js                42 kB
9:02:33 PM:   ├ chunks/main-1e7421553b9673ee.js                     26.9 kB
9:02:33 PM:   ├ chunks/pages/_app-9cd1d19dd7237c4c.js               493 B
9:02:33 PM:   ├ chunks/webpack-514908bffb652963.js                  770 B
9:02:33 PM:   └ css/6a26846526b2b5d9.css                            44 B
9:02:33 PM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
9:02:33 PM: ​
9:02:33 PM: (build.command completed in 19s)
9:02:33 PM: ​
9:02:33 PM: ────────────────────────────────────────────────────────────────
9:02:33 PM:   2. Deploy site                                                
9:02:33 PM: ────────────────────────────────────────────────────────────────
9:02:33 PM: ​
9:02:33 PM: Starting to deploy site from 'site/.next'
9:02:33 PM: Creating deploy tree 
9:02:33 PM: Creating deploy upload records
9:02:34 PM: 14 new files to upload
9:02:34 PM: 0 new functions to upload
9:02:34 PM: Site deploy was successfully initiated
9:02:34 PM: ​
9:02:34 PM: (Deploy site completed in 697ms)
9:02:34 PM: ​
9:02:34 PM: ────────────────────────────────────────────────────────────────
9:02:34 PM:   Netlify Build Complete                                        
9:02:34 PM: ────────────────────────────────────────────────────────────────
9:02:34 PM: ​
9:02:34 PM: (Netlify Build completed in 19.9s)
9:02:34 PM: Starting post processing
9:02:34 PM: Caching artifacts
9:02:34 PM: Started saving node modules
9:02:34 PM: Finished saving node modules
9:02:34 PM: Started saving build plugins
9:02:34 PM: Finished saving build plugins
9:02:34 PM: Post processing - HTML
9:02:34 PM: Started saving pip cache
9:02:35 PM: Finished saving pip cache
9:02:35 PM: Started saving emacs cask dependencies
9:02:35 PM: Finished saving emacs cask dependencies
9:02:35 PM: Started saving maven dependencies
9:02:35 PM: Finished saving maven dependencies
9:02:35 PM: Started saving boot dependencies
9:02:35 PM: Finished saving boot dependencies
9:02:35 PM: Started saving rust rustup cache
9:02:35 PM: Finished saving rust rustup cache
9:02:35 PM: Started saving go dependencies
9:02:35 PM: Finished saving go dependencies
9:02:35 PM: Build script success
9:02:35 PM: Post processing - header rules
9:02:35 PM: Post processing - redirect rules
9:02:35 PM: Post processing done
9:02:36 PM: Site is live ✨
9:03:00 PM: Finished processing build request in 1m1.362171277s

That certainly makes it seem like the site should show up, but it’s not.

Any ideas?

P.S. the internal site name is: laughing-wilson-f8bf67 if that matters

Thanks,

-a

Hi @TheIdOfAlan,

it doesn’t look like you’ve installed the required Next.js plugin to use Next.js on Netlify. Would you give that a try?

sure thing! how do I do that?

The deploy log has a link in the start that says “Essential Next.js plugin is not installed”. Following that should help.

hmmmm. I just searched for the word “Essential” in the log file I pasted and I don’t see it?

Did I miss something?

-a

It’s right here:

Just click on Install plugin

That did it. Thanks!

-a