Hi, @BernardA, I see your build doing nuxt build but I don’t see the nuxt export step happening as covered in the Nuxt docs here.
I think you’ll either need to use nuxt build && nuxt export or nuxt generate as the build command (depending on your Nuxt.js version). Also the publish directory should be “public” and not /public (meaning there should not be a forward slash used).
Hi @luke. Somehow we started with Nextjs and ended up in Nuxtjs. Very close, I know, but still not the same.
It’s Nextjs and the only command required normally is npm run build.
Locally I would also need npm run start to actually start the server, but that step is not normally needed at your end.
By the way, I attempted to deploy another Nextjs ( not Nuxtjs ) app yesterday - a much simpler one - with the same results.
Here is its URL => https://angry-hawking-9900a8.netlify.app/
I can pass you additional info on this other one. Please let me know.
Cheers
Hi, @BernardA, the most recent build for that site was successful but doesn’t generate any HTML files. I see index.js but not index.html.
Your repo is private so I cannot test the build myself. It would be helpful to see the package.json file though. Would you be willing to post that here?
Both of those services run dynamic code in ways that we don’t. I think you should probably start reading here about best practices in using next on netlify:
None of us on the support team are next.js experts (nor vercel, nor heroku experts - but I do know that their services support more types of dynamic pages than ours does with the default configurations), so hopefully one of those can give you some guidance!
Hi, @BernardA, we are in support of the Jamstack site design philosophy which involves a move away from server-side rendering. We do not hide this nor do we hide that Netlify doesn’t support server-side rendering by default.
People workaround this using Functions but that isn’t necessarily identical to server-side rendering.
I personally wrote this support guide as this is a misconception I spend a fair amount of time explaining:
I tried to clarify we were looking for a static version of the site’s files 18 days ago:
To summarize, there is no server-side rendering at Netlify (without a workaround using Functions) and we are transparent about this.
I’m one of the (volunteer) Community Pilots here in the Community and do have experience with Next, Heroku, Vercel, and the tooling you’re referencing.
The simple fact is that Netlify is UNABLE to deploy Nextjs applications WITHOUT LOSING FUNCTIONALITY.
That may work for simple static sites, but not for any more complex apps.
I’ll fully echo @luke’s post above about the premise and principle of JAMstack but Next.js is a complex project and offers multiple ways of ‘running’. To take bold strokes and say that any way of using Next.js is wrong, “simple”, or unsupported is to fundamentally misunderstand the flexibility of Next.js. React’s DOMServer<->Hydrate model that Next’s static-generation is built on is some of the most revolutionary stuff out there right now.
If you finish reading Luke’s guide that he linked to above, I recommend reading this thread. It’s a thorough explanation of the architectural differences in running a managed Next.js process acting as a request interop vs. using Next.js as a static site generator - both of which are valid and useful functions of Next.js that the Next.js core team is actively building. Neither is bad, and depending on how you choose to architect your application, neither “loses functionality” in any way. It’s just moving what-builds-when and what-renders-when.
I hope that helps.
Elon Musk doesn’t fix internal combustion engines, but both internal combustion cars and Teslas are great
Thanks.
Unfortunately there seems to be a huge bias in the sense that whenever one argues about Nextjs or Gatsby he/she reaches for the inevitable blog example.
Regardless of the limitations or arguing about such a limited scope ie, the blog, if one reads next-on-netlify or Nextjs docs on export there are clear caveats that are mentioned there.
So, unless a clear alternative way is pointed out, the fact remains that Netlify is not able to handle Nextjs full functionality.
I ended up here after a google search for “netlify nextjs deploy page not found” (something like that) and in my case, it was actually pretty straightforward to set it up.
For those searching for a solution, I added netlify.toml to my project root with content;
[build]
command = "npm run build && npm run export"
publish = "out"
Then add the export script to package.json;
"scripts": {
"export": "next export"
},
Build settings for the netlify project;
Build command: npm run build && npm run export
Publish directory: out
@kerem It did fix failed deployment for my nextjs web application on netlify but the page not found issue persisted when i try to visit site domain from my netlify dasboard. I have read a couple of blogs and suggestions in the community but havenot been successful.