Hello, I have a problem with deploying my NextJS site.
I run a deploy, and I works totally fine and the site is live. Then I go to the site and get a “Page Not Found”-message.
When I download the build files it seems like it is just hosting all the files (within same folders) from Github. I have tried to go to the domain/pages/index.js and it works and I get the code.
I have readed a lot at that page, but didnt find any answer.
But, I have a theory. I think I cant server the page with Netlify because I use getServerSideProps
I’m having the very same issue.
My web app was building alright and being exported correctly until I added fallback: true to some of my blog pages and this config generates an SSG instead of a purely static web site. SSGs can not be exported, so there isn’t an “out/” folder with an index file that can be served.
Hi, @darksoulsong, I know SSG as meaning “Static Site Generator”:
Is it possible you mean that the build generates code which does server-side rendering (SSR) and not SSG? (If not, what does SSG stand for?)
If you are trying to due SSR at Netlify first please read this:
That guide explains why SSR doesn’t work “out of the box” at Netlify. The following blog post, however, gives examples how it can be done using Functions:
Hello Luke, sorry for keeping you waiting, I just had the time to answer now.
I’m referring to NextJS’s fallback feature on the newer versions. There are two new functions, getStaticProps and getStaticPaths with the mandatory fallback prop, which basically displays a 404 page on nonexistent content on false or tries to generate the pages dynamically on true.I’m not certain if NextJS uses SSR in the backgrounds to make this work.