Getting 500 error with my Nextjs app that works perfect locally


I have this nextjs app that has worked perfectly before yesterday, but today when I just commited some new images I get 500 on all pages.
This is my site

And this is what I can see in the logs.

Nov 11, 03:03:09 PM: 46859121 ERROR  Invariant: failed to load static page {Nov 11, 03:03:09 PM: 46859121 ERROR    "page": "/",Nov 11, 03:03:09 PM: 46859121 ERROR    "url": "/",Nov 11, 03:03:09 PM: 46859121 ERROR    "initUrl": ""Nov 11, 03:03:09 PM: 46859121 ERROR  }Nov 11, 03:03:09 PM: 46859121 ERROR  MissingStaticPage [Error]: Failed to load static file for page: / Failed to download 404 Not FoundNov 11, 03:03:09 PM: 46859121 ERROR      at /var/task/node_modules/next/dist/server/require.js:55:19Nov 11, 03:03:09 PM: 46859121 ERROR      at processTicksAndRejections (node:internal/process/task_queues:96:5)Nov 11, 03:03:09 PM: 46859121 ERROR      at async Promise.all (index 2)Nov 11, 03:03:09 PM: 46859121 ERROR      at async Object.loadComponents (/var/task/node_modules/next/dist/server/load-components.js:53:49)Nov 11, 03:03:09 PM: 46859121 ERROR      at async NextNodeServer.findPageComponents (/var/task/node_modules/next/dist/server/next-server.js:429:36)Nov 11, 03:03:09 PM: 46859121 ERROR      at async NextNodeServer.renderPageComponent (/var/task/node_modules/next/dist/server/base-server.js:1127:24)Nov 11, 03:03:09 PM: 46859121 ERROR      at async NextNodeServer.renderToResponse (/var/task/node_modules/next/dist/server/base-server.js:1149:32)Nov 11, 03:03:09 PM: 46859121 ERROR      at async NextNodeServer.pipe (/var/task/node_modules/next/dist/server/base-server.js:638:25)Nov 11, 03:03:09 PM: 46859121 ERROR      at async Object.fn (/var/task/node_modules/next/dist/server/base-server.js:505:21)Nov 11, 03:03:09 PM: 46859121 ERROR      at async Router.execute (/var/task/node_modules/next/dist/server/router.js:213:36)

I also tried to Netlify CLI locally and that works. And I can also build it locally and it works like a charm.

Can someone please help me?

1 Like

Same issue here, sites were working just a few minutes ago:

Here’s the repository:

It’s a website template that uses Next and Netlify CMS. Each branch is its own website with its own content and images. I pushed a change to config.yml so that all fields were not required, and now all I get is a generic “Internal Server Error” with no information.

I checked the build logs and notices that my pages come up as “0 bytes” in size, but I don’t know if that’s just me reading it wrong:

11:33:28 AM: Route (pages)                              Size     First Load JS
11:33:28 AM: ┌ ○ / (303 ms)                             56.6 kB         189 kB
11:33:28 AM: ├   └ css/18a43f90bf5ee566.css             3.5 kB
11:33:28 AM: ├   /_app                                  0 B             133 kB
11:33:28 AM: ├ ○ /404                                   2.68 kB         136 kB
11:33:28 AM: └ λ /api/contact                           0 B             133 kB
11:33:28 AM: + First Load JS shared by all              133 kB
11:33:28 AM:   ├ chunks/framework-5f4595e5518b5600.js   42 kB
11:33:28 AM:   ├ chunks/main-40e3a245dac91539.js        29.1 kB
11:33:28 AM:   ├ chunks/pages/_app-65a0af09945efe21.js  59.9 kB
11:33:28 AM:   └ chunks/webpack-a3b997588ef5ecbd.js     1.86 kB
11:33:28 AM: λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
11:33:28 AM: ○  (Static)  automatically rendered as static HTML (uses no initial props)
11:33:28 AM: Done in 21.13s.


Same. The main build looks fine but I get the above when trying to load the site

Similar issue. Build worked fine last night, this morning’s build is giving me a html page with no css, and some of my links go to 500 errors. I reverted to the last known working build and it works fine. I did see the following line in my build logs:

You have the following Netlify rewrites that might cause conflicts with the Next.js Runtime:

This is followed by a couple hundred image paths.

Also getting internal server issue, reassuring to know it’s not just my site :slight_smile:

1 Like

For some additional context, I just ran a deploy on another Next.JS site that has not yet been upgraded to Next.js version 13.0 and did not run into any issues. I’d interested to know if this may be a compatibility issue with Next.JS 13.0.

I’m facing the same issue, it’s a simple Next site and works perfectly on local, Netlify builds states everything is ok, but site is just the Error message:

Same here. It worked fine and after a new deploy I have this issue.
Also, I wanted to redeploy the failing branch but with the misleading UI, I redeployed the main branch and now my site is down… Great…

@florian_pou Go to the deploys page, click your most recent successful deploy, and click “Publish Deploy”. You should be able to go back that way.

Already did. My code has not changed. It’s on Netlify side.

Hey folks - Our dev team is looking into this now; we hope to have a fix shortly.

1 Like

Thanks for your patience, everyone. Could you please try rebuilding your sites and letting me know if the behavior changes? We have rolled back a change that we think was causing it, but it will require a rebuild to fix if our estimation is correct.

Please share your results here so we can understand if we need to continue to work on this!


Thank you sir, with a rebuild it works again.

This is just some proof of the fix working, and also a sneaky invitation to our fav editor conf.


@fool Yes, new deploy works. Thanks for looking into this.

Thanks, it works now :ok_hand:

Hi @fool ,
I’m getting the same error and it’s still happening / not going away with rebuild.
Any more info on this?

Many thanks

Yes! It works now! Thank you for the response

hiya @Britnell,

Whatever may still be happening it is likely not the same root cause as started this thread since that is a bug we fixed last week :slight_smile:

I’d suggest sending over an x-nf-request-id of one of the 500’s so we can try to advise. Here’s what that is:

thanks for the link, my issue was resolved to but that’s great to know!
many thanks for the support

Hi @Britnell, thank you for coming back and letting us know you resolved your issue! Happy building. :netliconfetti: