# NextJS site published successfully, but just 404

**URL:** <https://answers.netlify.com/t/nextjs-site-published-successfully-but-just-404/81737>\
**Category:** Support\
**Tags:** nextjs, deployment\
**Created:** [December 22, 2022, 12:27am UTC](https://answers.netlify.com/t/nextjs-site-published-successfully-but-just-404/81737 "2022-12-22T00:27:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nk9](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nk9/32/44065_2.png) [@nk9](https://answers.netlify.com/u/nk9)\
**Post date:** [December 22, 2022, 12:27am UTC](https://answers.netlify.com/t/nextjs-site-published-successfully-but-just-404/81737/1 "2022-12-22T00:27:22Z")

</div>

- [https://stirring-churros-252537.netlify.app/](https://stirring-churros-252537.netlify.app/)
- No custom domain
- No build problem
- build settings:

```auto
Base directory
    Not set
Build command
    next build
Publish directory
    .next
Build status
    Active

```

Git repo of the source: [https://github.com/nk9/bryson-9](https://github.com/nk9/bryson-9)

When I download the site as a package, it all looks OK I think.

 ![image](https://global.discourse-cdn.com/netlify/original/3X/b/d/bd749fe3c280a2bc767a1b097f9d2be01f2f2eac.png)

Here is the build on Netlify:

```auto
12:04:34 AM: Route (pages) Size First Load JS
12:04:34 AM: ┌ ○ / (1926 ms) 1.07 kB 106 kB
12:04:34 AM: ├ /_app 0 B 85.4 kB
12:04:34 AM: ├ ○ /404 181 B 85.6 kB
12:04:34 AM: ├ λ /api/check_numbers 0 B 85.4 kB
12:04:34 AM: ├ ○ /check1 (2019 ms) 1.86 kB 132 kB
12:04:34 AM: ├ ○ /check2-89o6Q (2044 ms) 1.87 kB 132 kB
12:04:34 AM: ├ ○ /check3-46GfRA (1967 ms) 1.9 kB 132 kB
12:04:34 AM: ├ ○ /page2 (1985 ms) 3.23 kB 108 kB
12:04:34 AM: ├ ○ /page3 (2079 ms) 3.2 kB 108 kB
12:04:34 AM: └ ○ /success-nKsp7L (1907 ms) 921 B 101 kB
12:04:34 AM: + First Load JS shared by all 85.6 kB
12:04:34 AM: ├ chunks/framework-3b5a00d5d7e8d93b.js 45.4 kB
12:04:34 AM: ├ chunks/main-f2e125da23ccdc4a.js 26.7 kB
12:04:34 AM: ├ chunks/pages/_app-65b8d67529ac7894.js 12.4 kB
12:04:34 AM: ├ chunks/webpack-0b5d8249fb15f5f3.js 939 B
12:04:34 AM: └ css/27d177a30947857b.css 194 B
12:04:34 AM: λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
12:04:34 AM: ○ (Static) automatically rendered as static HTML (uses no initial props)
12:04:34 AM: ​
12:04:34 AM: (build.command completed in 21.7s)

```

What am I missing?

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [December 22, 2022, 3:22pm UTC](https://answers.netlify.com/t/nextjs-site-published-successfully-but-just-404/81737/2 "2022-12-22T15:22:10Z")

</div>

Hey @nk9,

Did you make sure the Next.js Runtime is installed: [GitHub - netlify/next-runtime: The Next.js Runtime allows Next.js to run on Netlify with zero configuration](https://github.com/netlify/next-runtime#manually-installing-the-nextjs-runtime)?

It installs automatically in most cases, but if it did not, you might have to manually install it.

---

<div class="post-metadata">

**Author:** ![nk9](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nk9/32/44065_2.png) [@nk9](https://answers.netlify.com/u/nk9)\
**Post date:** [December 22, 2022, 3:36pm UTC](https://answers.netlify.com/t/nextjs-site-published-successfully-but-just-404/81737/3 "2022-12-22T15:36:46Z")

</div>

Thanks for the reply. It looks like the integration is already installed. Any other ideas?

 ![image](https://global.discourse-cdn.com/netlify/original/3X/5/b/5b88ec692aecc10e0cfa32b7ce792529821e5ef4.jpeg)

---

<div class="post-metadata">

**Author:** ![nk9](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nk9/32/44065_2.png) [@nk9](https://answers.netlify.com/u/nk9)\
**Post date:** [December 22, 2022, 10:57pm UTC](https://answers.netlify.com/t/nextjs-site-published-successfully-but-just-404/81737/4 "2022-12-22T22:57:11Z")

</div>

Oooooookay, so I just had another look and _it’s now working_. I didn’t change anything for the last 7 hours, no deploy. But: the site is now working as expected.

Is there any way I can determine what happened to fix it?

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [December 23, 2022, 1:11am UTC](https://answers.netlify.com/t/nextjs-site-published-successfully-but-just-404/81737/6 "2022-12-23T01:11:18Z")

</div>

Hi, @nk9. You can [download the deploys](https://docs.netlify.com/site-deploys/manage-deploys/#download-a-deploy) and that will reveal the root cause.

I’ve examined the traffic for the site since it was created. There have been 404s for only three deploys of the site, the three below:

[https://app.netlify.com/sites/stirring-churros-252537/deploys/63a39ce34684a50d0ae62482](https://app.netlify.com/sites/stirring-churros-252537/deploys/63a39ce34684a50d0ae62482)  
[https://app.netlify.com/sites/stirring-churros-252537/deploys/63a39d782460ac13497f3327](https://app.netlify.com/sites/stirring-churros-252537/deploys/63a39d782460ac13497f3327)  
[https://app.netlify.com/sites/stirring-churros-252537/deploys/63a39ee39d2bde0008e18312](https://app.netlify.com/sites/stirring-churros-252537/deploys/63a39ee39d2bde0008e18312)

If you download those three deploys and check the base directory of the zip file, please note that there is no `index.html` file. This is a requirement for the base path of `/` to return a 200 status.

I see that both the publish directory and the build command were changed around the time of the deploy that does contain the index.html file in the base of the publish directory. My best guess is those two changes were what fixed this.

Please reply anytime if there are other questions about this.

---

<div class="post-metadata">

**Author:** ![nk9](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nk9/32/44065_2.png) [@nk9](https://answers.netlify.com/u/nk9)\
**Post date:** [December 23, 2022, 4:57pm UTC](https://answers.netlify.com/t/nextjs-site-published-successfully-but-just-404/81737/7 "2022-12-23T16:57:21Z")

</div>

OK, that makes sense. Thanks for your help!
